When you submit a video to any of Hive’s models (classifier or detector), Hive automatically splits the video into frames based on a default or user-specified sampling frequency. Each frame is then processed by the model, and the results are combined into a single JSON response.
Classifiers will return an array of objects that include a time (timestamp) and classes (confidence scores for each class).
Detectors will return an array of objects that include a time and bounding_poly
(for bounding boxes around detected objects).
Synchronous (/sync) vs. Asynchronous (/async) Output Differences
Synchronous (/sync): The output is returned immediately once the video has been processed.
Note: In synchronous mode, you will not see media_link
in the JSON response.
Asynchronous (/async): You’ll receive a task reference that you can poll until processing completes.
Note: In asynchronous mode, each frame result may include a media_link
to the processed frame, allowing easier retrieval or viewing of the exact image that was classified/detected.
{
"output": [
{
"time": 0,
"classes": [
{
"class": "general_not_nsfw_not_suggestive",
"score": 0.7058501595243861
},
{
"class": "general_nsfw",
"score": 0.12669138033591393
},
{
"class": "general_suggestive",
"score": 0.16745846013969992
}
],
"media_link": "www.media_url.com/image1.jpg",
"subtask_no": 366
},
{
"time": 0.9676333333333333,
"classes": [
{
"class": "general_not_nsfw_not_suggestive",
"score": 0.9986390064645149
},
{
"class": "general_nsfw",
"score": 0.0008006852563126932
},
{
"class": "general_suggestive",
"score": 0.0005603082791726574
}
],
"media_link": "www.media_url.com/image2.jpg",
"subtask_no": 367
},
{
"time": 1.9686333333333335,
"classes": [
{
"class": "general_not_nsfw_not_suggestive",
"score": 0.9999421468597295
},
{
"class": "general_nsfw",
"score": 0.00003785532083901699
},
{
"class": "general_suggestive",
"score": 0.000019997819431634897
}
],
"subtask_no": 368
}
]
}
For more in-depth information, reach out to [email protected].