Subjects - Detections

A subject detection is an assertion about the subject media association from a user or a model.

Field
subject_uid
string
The unique ID of a Cogniac Subject.
media_id
string
The unique ID of a Cogniac Media item.
focus
map
(optional) Map or object identifying the portion or subregion of the media, (e.g. a particular box area or range of frames) with which the subject-media association is asserted.

If the entire media is processed, this field will be null.
detections
array
A list of subject-media assertion objects.

Retrieve Subject Detections

The Retrieve Subject Detections endpoint will return all subject-media assertions for a given subject and media object.

ArgumentExample
media_id
string
1789bc84c8cd8283ca9087
GET /1/subjects/{subject_uid}/detections
Host: https://api.cogniac.io

Example: Retrieve Subject Detections

curl -X GET https://api.cogniac.io/1/subjects/cat_123/detections?media_id=249i24hjkasd \
-H "Authorization: Bearer abcdefg.hijklmnop.qrstuvwxyz"
import requests
from pprint import pprint

my_headers = {"Authorization": "Bearer abcdefg.hijklmnop.qrstuvwxyz"}

res = requests.get("https://api.cogniac.io/1/subjects/cat_123/detections?media_id=249i24hjkasd",
                   headers=my_headers)

pprint(res.json())
{
  "subject_uid": "cat_123",
  "detections": [
    {
      "model_id": "Hpo-h-1ec0-to5dGrTAN9QeV6djep-CN_mtsv0_2000.tgz",
      "user_id": null,
      "probability": 0.75,
      "timestamp": 1481809927.390357,
      "app_id": "11SB22k4",
      "app_data_type": null,
      "app_data": null,
      "uncal_prob": 0.05,
      "prev_prob": null,
      "detection_id": "1hg2Srt8c"
    }, ...
  ],
  "media_id": "249i24hjkasd"
}