Skip to navigation

Video

Measure emotional expression on faces in uploaded images or streamed video.

The video endpoints measure emotional expression on faces in JPEG images you upload or in video you stream as JPEG frames. For each face they detect, the endpoints return its bounding box. For the largest faces in each image, 2 by default, they also return two lists of scores: expressions, such as amusement, and descriptions of visible facial actions, such as smile.

Upload or realtime

Both endpoints measure the same expressions and descriptions. Upload takes a set of images in one request, and realtime takes video one frame at a time. To measure a recorded video file, send its frames as JPEG images. Streaming them to realtime, as the Python and Node.js quickstarts do, takes as long as the video plays. To measure a recorded video faster than it plays, upload its frames instead.

UploadRealtime
EndpointPOST /v1/expression/video/fileWSS /v1/expression/video/realtime
InputOne or more JPEG images in one request, each up to 2 MB and 8,294,400 pixels, and up to 25 MB in allVideo frames, each a JPEG image in one binary frame
ResultsOne result per image, in the order the images were sentOne reply per frame: a measurement.result, or an error such as invalid_image_frame. An error such as message_too_large ends the session instead.
ConfigurationA config partsession.update, before the first frame
Face trackingface_id continues across requests when you ask for a face_state and pass it back within 24 hoursface_id follows the same face from frame to frame within a session
Recorded asA run under the run_idA run under the session_id

Next steps