object-detectionAutomatically detect removable objects in an image. Use the returned session_id and selected detected_objects item with the Remove Objects API.
/v1/images/detect-objectsCredit cost: 1
Authorization β This endpoint requires an API key. Pass it in the api-key header on every request. See the quickstart
| Name | Type | Status | Description |
|---|---|---|---|
input_image | file | Required | Image file or URL to detect objects in. |
lang | string | Optional | Language for object class names.(default: en) |
Objects detected successfullyDetectionResponse
| Name | Type | Description |
|---|---|---|
session_id | string | Session ID for the processed image. Pass as `original_session_id` to the Remove Objects API. |
detected_objects | object[] | Detected regions sorted by confidence (descending) |
box | number[] | Bounding box [x1, y1, x2, y2] |
mask | string | Base64-encoded RGBG mask (same resolution as bbox) |
accuracy | number | Confidence score (0.0 to 1.0) |
object_type | string | Detection category |
object_description | string | Detection class name |
curl -X POST "https://api.snapapi.ai/v1/images/detect-objects" \
-H "api-key: YOUR_API_KEY" \
-F "input_image=@./image.jpg" \
-F "lang=en"{
"session_id": "sess_abc123",
"detected_objects": [
{
"box": [
120,
50,
300,
400
],
"mask": "base64_encoded_data...",
"accuracy": 0.95,
"object_type": "person",
"object_description": "person"
}
]
}