Subjects - Detections
- 22 Dec 2023
- 1 Minute to read
- Print
- DarkLight
Subjects - Detections
- Updated on 22 Dec 2023
- 1 Minute to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
A subject detection is an assertion about the subject media association from a user or a model.
Field | |
---|---|
subject_uid | The unique ID of a Cogniac Subject. |
media_id | The unique ID of a Cogniac Media item. |
focus | (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. |
detections | 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.
Argument | Example |
---|---|
media_id | 1789bc84c8cd8283ca9087 |
GET /1/subjects/{subject_uid}/detections
Host: https://api.cogniac.io
Example: Retrieve Subject Detections
import requests
from pprint import pprint
my_headers = {"Authorization": "Bearer abcdefg.hijklmnop.qrstuvwxyz"}
# add the Subject_uid and Media ID
res = requests.get("https://api.cogniac.io/1/subjects/cat_123/detections?media_id=249i24hjkasd",
headers=my_headers)
if res.status_code == 200:
pprint(res.json())
else:
print(f"Error: {res.status_code}")
print(res.content)
{
"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"
}
Was this article helpful?