Upload images
Send one or more images, each as a file part, and, to change the defaults, settings as a JSON config part. The response holds one result per image, in the order the parts were sent. An image with no faces is a normal result with an empty faces array.
Detection and measurement
The server detects the faces in each image and lists them in faces. It measures the largest of them, up to the limit below, and lists those first, largest first.
- A face is skipped, and is not listed, if its detection confidence is below
face.thresholdor its bounding box is underface.min_sizepixels on its shorter side. - Each measured face carries its bounding box, its detection confidence, a
face_id, and two sets of scores:expressionsfor emotional expressions such as amusement or interest, anddescriptionsfor visible facial actions such as a smile or a jaw drop. - The faces that were not measured follow, most confident first, up to 32 faces in all. Each carries its bounding box and detection confidence, with
face_id,expressionsanddescriptionsnull. face_idtracks a face across the images of one request. A face normally keeps its ID while it is measured, and can get it back after it leaves the view or is no longer among the largest faces. IDs do not identify a person.- Across requests: IDs start again from 0 in every request. To keep them consistent, set
return_face_stateand pass the returnedface_stateasface_statein the next request.
Limits
Every image is checked before any is measured. One bad image fails the whole request, which then returns no results:
- Not a JPEG: rejected with
unsupported_media_type. - Over the image size or pixel limit: rejected with
image_too_large. - Cannot be decoded: rejected with
image_decode_failed, possibly after earlier images were measured.
Authentication
Request
Settings for a video request, sent as the JSON config part.
The face_state from an earlier response, so face_id continues from the faces that request saw. A state is accepted for 24 hours after it was issued. One that has expired, was altered, or was issued to another organization is ignored, and numbering starts again from 0.
The images, one JPEG per file part. Results are numbered by the order of the parts.
Response
One result per image, in the order the file parts were sent. An image with no faces still has a result, with faces empty.
Identifies the image within the run, counting from 0. A file request numbers its images by the order of the file parts; a realtime session numbers only the frames it answered with a measurement.
The faces detected in the image: the measured faces first, largest first, then the faces that were not measured, in descending order of confidence.
Present when return_face_state was set. Pass it unchanged as face_state in a later request, within 24 hours, to continue face_id numbering.

