Visual detection models localize an object of interest in an image by returning a box that bounds that object, as well as the type of that object, also referred to as the class. A detector can detect multiple objects of different classes per image. For each detection, a detector outputs a confidence score that is independent of any other detections.
The output object in Hive detection APIs lists each detected object, including:
- The geometric description of the detected bounding box.
- The predicted class for the detection.
- For some models, the confidence score for the detection.
When submitting a video to be processed, Hive’s backend splits the video into frames, runs the model on each frame, then recombines the results into a single response for the entire video. The video output for a detector is similar to a list of detection output objects, but with multiple timestamps.
Hive’s face detection model achieves state-of-the-art accuracy. Face detections are passed through an additional classification step to predict attributes like gender, age, or "liveness".
The gender classification model runs on-top of the face detections provided by the face detection model, and classifies faces as:
- other_gender: non-human face / indistinguishable gender
Hive detects perceived gender based on the physical appearance of a face in the given context. These detections are not predictions of gender identity and this model is not designed to be used as such.
The age classification model runs on-top of the face detections provided by the face detection model, and classifies faces as:
senior: 65 yrs old and above
middle_aged: 45-64 yrs old
adult: 18-44 yrs old
teenager: 13-17 yrs old
pre_teen: 5-12 yrs old, any kid older than a toddler but younger than a teen
toddler: 2-4 yrs old, starting to be able to walk / crawl
baby: 0-1 yrs old, recently born, unlikely to know how to walk / crawl
other_age: non-human face / indistinguishable age
Note: All of the above ranges are inclusive. In the range 13-17, for example, all ages 13.0-17.99 are included.
Age Regression (Beta)
This class returns a number representing the predicted exact age of the subject.
Liveness Classification (Beta)
The "liveness" classification model run on top of the face detection model and classifies faces as:
- primary: this face exists in the primary image
- secondary: this face exist in a image, screen, or painting inside of the primary image (ex: A face in a picture frame hung on the wall)
The request format for this API includes a field for the media being submitted, either as a local file path or as a url. For more information about submitting a task, see our API reference guides to synchronous and asynchronous submissions.
# submit a task with media with url curl --request POST \ --url https://api.thehive.ai/api/v2/task/sync \ # this is a sync example, see API reference for async --header 'accept: application/json' \ --header 'authorization: token <API_KEY>' \ --form 'url=http://hive-public.s3.amazonaws.com/demo_request/gun1.jpg' # submit a task with media with local media file curl --request POST \ --url https://api.thehive.ai/api/v2/task/sync \ # this is a sync example, see API reference for async --header 'Authorization: Token <token>' \ --form 'media=@"<absolute/path/to/file>"'
Updated 4 months ago
See the API reference for more details on the API interface and response format.