process_image
This method uses the EyeOnIt Large Vision Model to process a single base64-encoded image.
Method: POST
Endpoint: /process_image
Body
{
"file": "<base64 encoded image string>",
"return_image": true,
"regions": [
{
"enabled": true,
"name": "Back Alley",
"polygon": [
{
"x": 528,
"y": 175
},
{
"x": 876,
"y": 166
},
{
"x": 896,
"y": 285
},
{
"x": 506,
"y": 279
},
{
"x": 528,
"y": 175
}
],
"detection_configs": [
{
"class_name": "vehicle",
"class_threshold": 10,
"object_size": 150,
"object_descriptions": [
{
"text": "black sedan",
"threshold": 90,
"alert": true,
"background_prompt": false
},
{
"text": "vehicle",
"threshold": 90,
"alert": false,
"background_prompt": false
},
{
"text": "street building",
"threshold": null,
"alert": false,
"background_prompt": true
}
],
"conditions": [
{
"type": "count_greater_than",
"count": 0,
"line_name": null,
"alert_direction": null
}
],
"alert_seconds": 0.3,
"reset_seconds": 2.0,
"vms_config": null
}
]
},
],
}
Body Attribute Descriptions
Name | Type | Description |
---|---|---|
file | string | the base64 encoding of the image to process |
return_image | bool | true to return an annotated image. If false, no image will be returned. |
regions | Region[] | the array of regions to use for processing |
Response
{
"success": true,
"message": null,
"data": {
"detections": [
],
}
}
Response Attribute Descriptions
Name | Type | Description |
---|---|---|
success | boolean | true if the operation was successful. false otherwise. |
message | string | a human readable message describing the operation result |
data | JSON | provides a JSON array of data for detected objects as described below |
Data Object Attributes
The data element will contain a "detections" array. The objects in the array will take one of two forms. If the detection configuration that trigged the detection included a common object type, the data element will be a Detected Object as shown below:
{
"success": true,
"message": null,
"data": {
"detections": [
{
"class_name": "person",
"region": "Back Alley",
"objects": [
{
"object_description": "person holding weapon",
"confidence": 83,
"bounds": {
"left": 380,
"top": 105,
"width": 186,
"height": 522
}
},
{
"object_description": "person",
"confidence": 93,
"bounds": {
"left": 815,
"top": 123,
"width": 74,
"height": 236
}
}
]
}
],
"image": "<base64-encoded image>"
}
}
If the detection configuration that trigged the detection did not include a common object type, the element in the detections array will have the following form:
{
"success": true,
"message": null,
"data": {
"detections": [
{
"region": "Back Alley",
"object_descriptions": [
{
"text": "person",
"confidence": 67
},
{
"text": "person holding weapon",
"confidence": 99
}
]
}
],
"image": "<base64-encoded image>"
}
}