Classification result
The classification result is returned by:
POST /api/classify?sync=trueGET /api/result/{id}- Webhooks when webhook delivery is configured
Examples
Section titled “Examples”Missing API key (403)
Section titled “Missing API key (403)”{ "success": false, "error": "no access to current endpoint, make sure you are using correct API key"}Async response
Section titled “Async response”{ "id": "6662efdb5200108549e3ac2b", "accepted_at": "2024-06-07T13:32:43.811+02:00"}Sync response
Section titled “Sync response”{ "id": "6662f5c1f897618de43f0bbd", "status": { "classify": "accepted", "video": "accepted" }, "camera_id": "134188-VI08", "tenant": "test", "duration": 1434714, "duration_seconds": 1, "model": "noname", "version": "2.0.16123", "error_code": 0, "error_msg": "", "risk": "", "labels": ["intrusion"], "scores": { "person": 0.127, "vehicule": 0.893, "intrusion": 0.919, "flag": 0.830, "animal": 0.062, "plant": 0.049, "other": 0.020, "wind": 0.007, "rain": 0.005, "web": 0.004, "spider": 0.003, "text": 0.001, "NOTHING": 0.0003 }, "video": { "videoname": "video.mp4", "filesize": 246792, "specs": { "duration": 2.3, "fps": 2.61, "original.fps": 3, "original.height": 480, "original.width": 640, "width": 426, "height": 320, "nframes": 6, "original.nframes": 6 } }, "metadata": { "parc_origine": "XX", "client_id": 134188, "code_msg": "VI08", "no_trans": "20818" }, "created_at": "2024-06-07T13:57:55.230+02:00", "started_at": "2024-06-07T13:57:55.230+02:00"}Basic information
Section titled “Basic information”| Field | JSON | Description |
|---|---|---|
| ID | id | Unique identifier of the result (classify_id). |
| CameraID | camera_id | Camera identifier, derived from metadata. |
| Tenant | tenant | Tenant identifier (mandatory). |
| Model | model | Model used for classification (optional). |
| Version | version | Model version (optional). |
The camera_id is generated from metadata:
camera_id = metadata.client_id + metadata.camera_idcamera_id = metadata.client_id + metadata.code_msg // fallbackDuration
Section titled “Duration”| Field | Type | JSON | Description |
|---|---|---|---|
| Duration | int64 | duration | Classification duration in milliseconds. |
| DurationSeconds | int | duration_seconds | Classification duration in seconds. |
Status and errors
Section titled “Status and errors”| Field | Type | JSON | Description |
|---|---|---|---|
| Status | object | status | Nested status for classify and video processing. |
| ErrorCode | int | error_code | Error code (0 = success). |
| ErrorMessage | string | error_msg | Detailed error message. |
Status constants
Section titled “Status constants”| Value | Description |
|---|---|
accepted | The analysis has been accepted. |
in-progress | The analysis is currently in progress. |
done | The analysis is completed. |
error | An error occurred during the analysis. |
timeout | The analysis timed out. |
Analysis results
Section titled “Analysis results”| Field | Type | JSON | Description |
|---|---|---|---|
| Risk | string | risk | Risk level: safe, danger, or intrusion. |
| Labels | string[] | labels | Labels assigned by the analysis. |
| Scores | object | scores | Confidence scores per label (0.0–1.0). |
See Risk, labels, and scores for details on how scores determine risk levels.
Video details
Section titled “Video details”| Field | Type | JSON | Description |
|---|---|---|---|
| Videoname | string | videoname | Name of the video file. |
| Filesize | int | filesize | Video file size in bytes. |
| VideoSpecs | object | specs | Video specifications (resolution, fps, frame count). |
Timestamps
Section titled “Timestamps”| Field | Type | JSON | Description |
|---|---|---|---|
| CreatedAt | time | created_at | When the analysis was created. |
| StartedAt | time | started_at | When the analysis started. |
Metadata
Section titled “Metadata”| Field | Type | JSON | Description |
|---|---|---|---|
| Metadata | object | metadata | Optional additional data. See Metadata. |