Predictions API

Model Inferencing

Deployed models are available for inferencing using the Image Prediction API method, and the Video Prediction API method.
A generic object detection model is also available for inferencing. Read more about how to use this pre-trained model to return predictions on your data.

Authentication

Admins or Project Managers can generate an API Key in Settings to use for authentication. See the "Authorization" header below for details on using this key as a token.
post
https://<HOSTNAME>
/v1/models/:modelVersionId/predict
Image Prediction
Supported image types: JPG, PNG, GIF, BMP, TIFF, WEBP. File size limit is 10 MB.

Predict Image Examples

Send base64-encoded image as JSON:
1
curl -X POST 'https://<HOSTNAME>/v1/models/01F5PXD35EF2F8SBK27NM9ABC4/predict' \
2
--header 'Authorization: Bearer <APIKEY>' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{ "image": "RmgBDRSUtAgpKO9LQAlsKoisdiVzVNME1wQ2VoaUh6cmVTek5UY3" }'
Copied!
Send image as form data:
1
curl -X POST 'https://<HOSTNAME>/v1/models/01F5PXD35EF2F8SBK27NM9ABC4/predict' \
2
--header 'Authorization: Bearer <APIKEY>' \
3
--form '[email protected]/to/image.jpg'
Copied!

Using the Generic Object Detection Model

Plainsight has a generic object detection model that can be used to AutoLabel your data and for inference. This model is pre-trained on the COCO dataset (a large dataset of common objects) and can return detections as bounding boxes or instance segmentation label types.
To use the general object detection inference model, specify one of the following model IDs in the modelVersionID path parameter of you request:
01ERDH3S3TZ34S863N47RWECA7 for detections labeled using bounding boxes (rectangles)
01ERDH3S45QPEG9YAXM5Q0RQ7W for detections labeled using instance segmentation (polygons)
For example, to run inference on the general object detection model and return detections as bounding boxes:
1
curl -X POST 'https://<HOSTNAME>/v1/models/01ERDH3S3TZ34S863N47RWECA7/predict' \
2
--header 'Authorization: Bearer <APIKEY>' \
3
--form '[email protected]/to/image.jpg'
Copied!
post
https://<HOSTNAME>
/v1/models/:modelVersionId/batch-predict
Batch (Asynchronous) Video Prediction
get
https://<HOSTNAME>
/v1/models/:modelVersionId/batch-predict/:jobId/status
Job Status

Detections Output

Detections are output into a JSONL file. The URL to download this file is returned in the Job Status method upon successful completion of the job. Each line represents a frame of video.
    time - the timestamp of the frame
    frameIdx - index of frame within the video
    detection object(s):
      type - label type (rectangle, polygon, etc)
      data - coordinates of the label
      score - confidence score for this detection, ranging from 0.0-1.0
      trackId - tracking ID used to track an object from frame to frame
Example output:
1
{"time": "00:00:00", "frameIdx": 0, "car": [{"type": "rectangle", "data": {"min": [0.7001143646240234, 0.7087980821397569], "max": [0.742496337890625, 0.7544862874348959]}, "children": {}, "score": 0.8047651648521423, "trackId": 0}, {"type": "rectangle", "data": {"min": [0.7988925170898438, 0.7319180636935764], "max": [0.8485193634033203, 0.7780952284071181]}, "children": {}, "score": 0.7955709099769592, "trackId": 1}, {"type": "rectangle", "data": {"min": [0.0, 0.76564208984375], "max": [0.025728864669799803, 0.8191375732421875]}, "children": {}, "score": 0.7955175042152405, "trackId": 2}, {"type": "rectangle", "data": {"min": [0.94644287109375, 0.7661393229166666], "max": [0.9950425720214844, 0.8066242811414931]}, "children": {}, "score": 0.6790698766708374, "trackId": 3}, {"type": "rectangle", "data": {"min": [0.14806840896606446, 0.7507535129123264], "max": [0.22439971923828125, 0.8366963704427083]}, "children": {}, "score": 0.6356155872344971, "trackId": 4}, {"type": "rectangle", "data": {"min": [0.7422527313232422, 0.7078128390842013], "max": [0.7783774566650391, 0.7608119032118056]}, "children": {}, "score": 0.6314104795455933, "trackId": 5}, {"type": "rectangle", "data": {"min": [0.48819801330566404, 0.7427418348524305], "max": [0.5575634384155274, 0.8126653374565972]}, "children": {}, "score": 0.5785809755325317, "trackId": 6}]}
2
{"time": "00:00:00.120000", "frameIdx": 3, "car": [{"type": "rectangle", "data": {"min": [0.7001200103759766, 0.7078899468315972], "max": [0.7417404937744141, 0.7540592447916666]}, "children": {}, "score": 0.8145115971565247, "trackId": 3}, {"type": "rectangle", "data": {"min": [0.7980601501464843, 0.7328105333116319], "max": [0.8478513336181641, 0.7785378689236111]}, "children": {}, "score": 0.80238276720047, "trackId": 1}, {"type": "rectangle", "data": {"min": [0.0, 0.7655868191189236], "max": [0.02540128231048584, 0.8191928439670139]}, "children": {}, "score": 0.7748746871948242, "trackId": 2}, {"type": "rectangle", "data": {"min": [0.9465829467773438, 0.7661695014105903], "max": [0.9949024963378906, 0.8065941704644097]}, "children": {}, "score": 0.6508281230926514, "trackId": 0}, {"type": "rectangle", "data": {"min": [0.7423059844970703, 0.7077564832899306], "max": [0.7783242034912109, 0.7608683268229167]}, "children": {}, "score": 0.6322560906410217, "trackId": 5}, {"type": "rectangle", "data": {"min": [0.489085693359375, 0.7427151150173611], "max": [0.5574259567260742, 0.8140271674262153]}, "children": {}, "score": 0.6002546548843384, "trackId": 6}, {"type": "rectangle", "data": {"min": [0.14681857109069824, 0.7657845052083333], "max": [0.21683483123779296, 0.8350164794921875]}, "children": {}, "score": 0.5051438212394714, "trackId": 4}]}
3
{"time": "00:00:00.200000", "frameIdx": 5, "car": [{"type": "rectangle", "data": {"min": [0.7979566192626953, 0.7319490559895834], "max": [0.8479548645019531, 0.7780642361111111]}, "children": {}, "score": 0.8713392019271851, "trackId": 1}, {"type": "rectangle", "data": {"min": [0.7000874328613281, 0.7078708224826389], "max": [0.7417730712890624, 0.7540784369574652]}, "children": {}, "score": 0.8168344497680664, "trackId": 4}, {"type": "rectangle", "data": {"min": [0.0, 0.7655344645182292], "max": [0.025421178340911864, 0.8192451985677084]}, "children": {}, "score": 0.7828996181488037, "trackId": 2}, {"type": "rectangle", "data": {"min": [0.9465740966796875, 0.766183336046007], "max": [0.9949113464355469, 0.8065802680121528]}, "children": {}, "score": 0.6592091917991638, "trackId": 3}, {"type": "rectangle", "data": {"min": [0.7421274566650391, 0.70782958984375], "max": [0.7785027313232422, 0.7607952202690972]}, "children": {}, "score": 0.6189853549003601, "trackId": 5}, {"type": "rectangle", "data": {"min": [0.48903560638427734, 0.7427429877387153], "max": [0.5574760437011719, 0.8139992947048611]}, "children": {}, "score": 0.5979089736938477, "trackId": 6}]}
4
{"time": "00:00:00.320000", "frameIdx": 8, "car": [{"type": "rectangle", "data": {"min": [0.7988416290283203, 0.7318497043185764], "max": [0.8485702514648438, 0.778163587782118]}, "children": {}, "score": 0.8568191528320312, "trackId": 1}, {"type": "rectangle", "data": {"min": [0.6996240997314453, 0.7078053114149305], "max": [0.7422364044189453, 0.7541439480251736]}, "children": {}, "score": 0.8298211693763733, "trackId": 3}, {"type": "rectangle", "data": {"min": [0.0, 0.765592041015625], "max": [0.025442245006561278, 0.8191876220703125]}, "children": {}, "score": 0.7620850205421448, "trackId": 2}, {"type": "rectangle", "data": {"min": [0.9466223907470703, 0.7661448160807292], "max": [0.9948629760742187, 0.8066188557942708]}, "children": {}, "score": 0.690345823764801, "trackId": 4}, {"type": "rectangle", "data": {"min": [0.7422945404052734, 0.7079161919487847], "max": [0.7783356475830078, 0.7607086181640625]}, "children": {}, "score": 0.5972740054130554, "trackId": 5}, {"type": "rectangle", "data": {"min": [0.14873595237731935, 0.750741441514757], "max": [0.22373218536376954, 0.8367084418402778]}, "children": {}, "score": 0.5879378318786621, "trackId": 7}, {"type": "rectangle", "data": {"min": [0.4890005111694336, 0.7425733100043402], "max": [0.5575111389160157, 0.8128338623046875]}, "children": {}, "score": 0.5386565923690796, "trackId": 6}]}
5
{"time": "00:00:00.400000", "frameIdx": 10, "car": [{"type": "rectangle", "data": {"min": [0.6995636749267579, 0.7082058376736111], "max": [0.7422968292236328, 0.753743421766493]}, "children": {}, "score": 0.8554792404174805, "trackId": 4}, {"type": "rectangle", "data": {"min": [0.7996922302246093, 0.7325918240017361], "max": [0.8492200469970703, 0.778756578233507]}, "children": {}, "score": 0.806079089641571, "trackId": 1}, {"type": "rectangle", "data": {"min": [0.0, 0.7671257866753473], "max": [0.025510644912719725, 0.8189889865451389]}, "children": {}, "score": 0.6845098733901978, "trackId": 2}, {"type": "rectangle", "data": {"min": [0.9361000061035156, 0.7669605170355903], "max": [0.9963831329345703, 0.8058031548394097]}, "children": {}, "score": 0.6576622128486633, "trackId": 3}, {"type": "rectangle", "data": {"min": [0.7422310638427735, 0.7085048421223958], "max": [0.7783990478515626, 0.7601199001736111]}, "children": {}, "score": 0.6540669202804565, "trackId": 5}, {"type": "rectangle", "data": {"min": [0.1461125946044922, 0.795661146375868], "max": [0.1805940818786621, 0.8291719563802084]}, "children": {}, "score": 0.6369971632957458, "trackId": 8}, {"type": "rectangle", "data": {"min": [0.14645214080810548, 0.7578844536675348], "max": [0.22301523208618165, 0.8335708279079861]}, "children": {}, "score": 0.5972306132316589, "trackId": 7}, {"type": "rectangle", "data": {"min": [0.09434420585632325, 0.7698390706380208], "max": [0.12827395439147948, 0.8162757025824653]}, "children": {}, "score": 0.5838125944137573, "trackId": 9}, {"type": "rectangle", "data": {"min": [0.4893690872192383, 0.7425895182291666], "max": [0.5571425628662109, 0.8141527642144097]}, "children": {}, "score": 0.5766813158988953, "trackId": 6}, {"type": "rectangle", "data": {"min": [0.5697303009033203, 0.7300347900390625], "max": [0.6215675354003907, 0.7652922905815972]}, "children": {}, "score": 0.5320419073104858, "trackId": 10}]}
6
{"time": "00:00:00.520000", "frameIdx": 13, "car": [{"type": "rectangle", "data": {"min": [0.1442272663116455, 0.7567987738715278], "max": [0.2228019905090332, 0.8333213297526042]}, "children": {}, "score": 0.8348209261894226, "trackId": 7}, {"type": "rectangle", "data": {"min": [0.7987076568603516, 0.7309903293185764], "max": [0.8487042236328125, 0.7776878526475695]}, "children": {}, "score": 0.8244227766990662, "trackId": 1}, {"type": "rectangle", "data": {"min": [0.0, 0.7662373860677083], "max": [0.02554854154586792, 0.8198773871527778]}, "children": {}, "score": 0.7334166169166565, "trackId": 2}, {"type": "rectangle", "data": {"min": [0.7007211303710937, 0.7085287814670139], "max": [0.7418894958496094, 0.7547555881076389]}, "children": {}, "score": 0.7187542915344238, "trackId": 3}, {"type": "rectangle", "data": {"min": [0.7418098449707031, 0.7061136881510417], "max": [0.7773199462890625, 0.7598409016927083]}, "children": {}, "score": 0.6801111102104187, "trackId": 5}, {"type": "rectangle", "data": {"min": [0.9350718688964844, 0.7669188096788194], "max": [0.9959108734130859, 0.8058448621961806]}, "children": {}, "score": 0.6667593121528625, "trackId": 4}, {"type": "rectangle", "data": {"min": [0.5675093841552734, 0.7281532118055556], "max": [0.6297899627685547, 0.7671738688151042]}, "children": {}, "score": 0.6150084733963013, "trackId": 10}, {"type": "rectangle", "data": {"min": [0.09586554527282715, 0.76857421875], "max": [0.12937828063964843, 0.8162054443359374]}, "children": {}, "score": 0.6082856059074402, "trackId": 9}, {"type": "rectangle", "data": {"min": [0.14507335662841797, 0.7785641818576389], "max": [0.1825710678100586, 0.8329177517361112]}, "children": {}, "score": 0.5406203866004944, "trackId": 8}]}
7
{"time": "00:00:00.640000", "frameIdx": 16, "car": [{"type": "rectangle", "data": {"min": [0.14417657852172852, 0.7569097222222222], "max": [0.2226651382446289, 0.8332103814019097]}, "children": {}, "score": 0.8460432887077332, "trackId": 8}, {"type": "rectangle", "data": {"min": [0.7004826354980469, 0.7091966417100695], "max": [0.7421280670166016, 0.7540877278645833]}, "children": {}, "score": 0.806346595287323, "trackId": 7}, {"type": "rectangle", "data": {"min": [0.7997734069824218, 0.7327389865451389], "max": [0.8476384735107422, 0.775939195421007]}, "children": {}, "score": 0.7701347470283508, "trackId": 1}, {"type": "rectangle", "data": {"min": [0.0, 0.7660401746961806], "max": [0.025666043758392335, 0.8200745985243055]}, "children": {}, "score": 0.758480429649353, "trackId": 2}, {"type": "rectangle", "data": {"min": [0.7415583038330078, 0.7069877794053819], "max": [0.7768212890625, 0.7603018527560764]}, "children": {}, "score": 0.6612362861633301, "trackId": 5}, {"type": "rectangle", "data": {"min": [0.5687237167358399, 0.7294388156467014], "max": [0.6225741195678711, 0.7658882649739583]}, "children": {}, "score": 0.6109995245933533, "trackId": 4}, {"type": "rectangle", "data": {"min": [0.09434274673461913, 0.7701981608072916], "max": [0.1290256118774414, 0.8159166124131945]}, "children": {}, "score": 0.5956371426582336, "trackId": 9}, {"type": "rectangle", "data": {"min": [0.9266272735595703, 0.7696741400824653], "max": [0.9953533172607422, 0.8030894639756945]}, "children": {}, "score": 0.5858432054519653, "trackId": 3}, {"type": "rectangle", "data": {"min": [0.4889754104614258, 0.7424461534288195], "max": [0.5567860412597656, 0.8129610188802083]}, "children": {}, "score": 0.5347800850868225, "trackId": 6}, {"type": "rectangle", "data": {"min": [0.14479297637939453, 0.7775484212239583], "max": [0.18285144805908204, 0.8325984022352431]}, "children": {}, "score": 0.5075516700744629, "trackId": 10}]}
8
{"time": "00:00:00.720000", "frameIdx": 18, "car": [{"type": "rectangle", "data": {"min": [0.7993070220947266, 0.7322889539930556], "max": [0.8511056518554687, 0.7777243381076389]}, "children": {}, "score": 0.8554795980453491, "trackId": 1}, {"type": "rectangle", "data": {"min": [0.7002946472167969, 0.710480482313368], "max": [0.7423159790039062, 0.7541389295789931]}, "children": {}, "score": 0.7996271252632141, "trackId": 3}, {"type": "rectangle", "data": {"min": [0.0, 0.7663991292317708], "max": [0.025371847152709962, 0.8197156439887153]}, "children": {}, "score": 0.7976168394088745, "trackId": 2}, {"type": "rectangle", "data": {"min": [0.5691310882568359, 0.7296035427517361], "max": [0.622166748046875, 0.7657234700520833]}, "children": {}, "score": 0.6927707195281982, "trackId": 9}, {"type": "rectangle", "data": {"min": [0.7416486358642578, 0.7074123806423611], "max": [0.77673095703125, 0.7598773193359375]}, "children": {}, "score": 0.6590728163719177, "trackId": 5}, {"type": "rectangle", "data": {"min": [0.15913079261779786, 0.7441860622829861], "max": [0.2365931510925293, 0.8312477620442709]}, "children": {}, "score": 0.6562774777412415, "trackId": 8}, {"type": "rectangle", "data": {"min": [0.14653841018676758, 0.7940071614583334], "max": [0.18054336547851563, 0.8294908311631944]}, "children": {}, "score": 0.617221474647522, "trackId": 10}, {"type": "rectangle", "data": {"min": [0.48919025421142576, 0.7426589626736111], "max": [0.5573213958740234, 0.8127482096354167]}, "children": {}, "score": 0.5728475451469421, "trackId": 6}, {"type": "rectangle", "data": {"min": [0.09469179153442382, 0.7692333306206597], "max": [0.1284890079498291, 0.8155463324652777]}, "children": {}, "score": 0.5208727717399597, "trackId": 4}]}
9
{"time": "00:00:00.800000", "frameIdx": 20, "car": [{"type": "rectangle", "data": {"min": [0.7992606353759766, 0.7318089463975694], "max": [0.8496516418457031, 0.778204345703125]}, "children": {}, "score": 0.875287652015686, "trackId": 1}, {"type": "rectangle", "data": {"min": [0.00018331080675125123, 0.764676038953993], "max": [0.02326004981994629, 0.8187685139973958]}, "children": {}, "score": 0.8330589532852173, "trackId": 2}, {"type": "rectangle", "data": {"min": [0.7003234100341796, 0.7106207275390625], "max": [0.7422872924804688, 0.7539986843532986]}, "children": {}, "score": 0.8263353705406189, "trackId": 7}, {"type": "rectangle", "data": {"min": [0.7415248870849609, 0.7084487575954861], "max": [0.7768547821044922, 0.7601760525173611]}, "children": {}, "score": 0.7250340580940247, "trackId": 5}, {"type": "rectangle", "data": {"min": [0.5678661727905273, 0.7281162516276042], "max": [0.6294331741333008, 0.7672108289930556]}, "children": {}, "score": 0.7118926644325256, "trackId": 9}, {"type": "rectangle", "data": {"min": [0.14996875762939454, 0.7464505343967014], "max": [0.23318952560424805, 0.83432373046875]}, "children": {}, "score": 0.672606348991394, "trackId": 8}, {"type": "rectangle", "data": {"min": [0.48922512054443357, 0.7422311062282986], "max": [0.5580366897583008, 0.8145111762152778]}, "children": {}, "score": 0.6424439549446106, "trackId": 6}, {"type": "rectangle", "data": {"min": [0.14664278984069823, 0.7816626654730903], "max": [0.18137672424316406, 0.8324894883897569]}, "children": {}, "score": 0.5970743894577026, "trackId": 10}, {"type": "rectangle", "data": {"min": [0.9294758605957031, 0.7699845377604166], "max": [0.99550537109375, 0.8027790662977431]}, "children": {}, "score": 0.5623807311058044, "trackId": 3}, {"type": "rectangle", "data": {"min": [0.09595375061035157, 0.7683754475911458], "max": [0.12910252571105957, 0.8164042154947917]}, "children": {}, "score": 0.5287332534790039, "trackId": 4}]}
Copied!
Last modified 25d ago