Video Detection Faces

Detects the faces in the video with the YuNet model and outputs their boxes, five key points (eyes, nose, mouth corners), scores, roll angles and stable ids, plus a square crop of the main face on a second output. Use it to react to an audience: the number of spectators, the nearest face, a face crop for effects.

The speaker's face (id 1, red) and the face of the poster at the left (id 2, blue, score 0.88), each with its box and its 5 points.

The face output of the same frame: the speaker's face as a square crop (face size 256, face zoom 1.6).

The model runs on a thread of the module, on a copy of the frame: the video is never delayed, and the outputs are those of the last finished inference. The faces are listed by size, the largest first: index 0 is the main face, the one of the face output. A frame costs about 3.3 ms at 1920 x 1080 and 7.2 ms at 3840 x 2160, the face crop included.

Settings

bypass

Bypasses the module processing when activated (ON).

  • OFF (0): Module processes normally
  • ON (1): Input passes directly to output without processing

video in

Video input flow(s).

video out

Video output flow(s).

face

Video output of the main face (index 0, the largest), cropped on every frame as a square of face size pixels, turned so that the eyes are level when align is ON. It is black when no face is found and empty in bypass. The crop runs even when this output is not connected: about 2 ms per frame at 1920 x 1080 and 4 ms at 3840 x 2160.

process time

Total time used for the calculation of the module.

threshold

Minimum score of a face, from 0 to 1 (default 0.6). At 0.99 no face is found; at 0 false faces appear, up to max faces.

max faces

Largest number of faces output, from 1 to 32 (default 8): the faces of best score are kept, then listed by size.

smooth

Smoothing of the boxes and the points from one inference to the next, from 0 to 0.95 (default 0.3). At 0 the outputs follow each inference exactly; higher values are steadier and react more slowly. The scores are not smoothed.

overlay

When ON (default), draws on video out 1 the box and the 5 points of each face, in a color given by its id. The lines are thicker on large frames, so that they stay visible on a screen. When OFF, video out 1 is the input unchanged.

face size

Side of the face output, from 32 to 1024 pixels (default 256).

face zoom

Side of the crop of the face output in sizes of the face box (its larger side), from 1 to 4 (default 1.6): 1 shows the box only, higher values show more of the head and its surroundings. The parts of the crop outside the frame are black.

align

When ON (default), turns the crop of the face output by the angle of the face so that the eyes are level. The model follows a tilt of the head only in part (see angle), so align mostly removes small angles.

sync

When ON, video out 1 and face show the analysed frame with its own results, kept until the next result: the boxes line up exactly, but the picture changes only at the rate of the inferences. When OFF (default), they show the live video with the results of the last inference, a few milliseconds late.

threads

Number of threads ONNX Runtime uses for the model, from 1 to 8 (default 2). Changing it reloads the model. This inlet is hidden by default.

count

Number of faces found, from 0 to max faces: the length of the arrays below, and 5 times the length of landmarks x and landmarks y.

input = the picture above, default settings
count = 2
x = [0.509, 0.116]
score = [0.93, 0.88]
id = [1, 2]

x

Array of the x of the center of each face box, from 0 (left edge) to 1 (right edge), the largest face first.

y

Array of the y of the center of each face box, from 0 (top edge) to 1 (bottom edge).

w

Array of the width of each face box, from 0 to 1 in frame widths.

h

Array of the height of each face box, from 0 to 1 in frame heights.

score

Array of the detection score of each face, from 0 to 1.

id

Array of the id of each face, from 1 to 999999. A face keeps its id while its box overlaps its box of the previous inference (intersection over union of at least 0.3); a new face gets the next id, so a face that is lost and found again gets a new one.

angle

Array of the roll of each face, from -180 to 180 degrees: the angle of the line from the right eye to the left eye, positive clockwise on the screen, 0 for an upright face. It is a coarse value: the model follows a tilt only in part (a face tilted by 30 degrees reads 0 to 9 degrees), and on a still face it varies by about 1 degree from frame to frame.

landmarks x

Array of the x of the 5 key points of each face, from 0 (left edge) to 1 (right edge), 5 values per face: the right eye, the left eye, the tip of the nose, the right and the left corners of the mouth (right and left of the person).

count = 2
landmarks x = [right eye, left eye, nose, mouth right, mouth left of face 0, the same 5 points of face 1]

landmarks y

Array of the y of the same points, from 0 (top edge) to 1 (bottom edge), in the same order.

inference time

Time of the last analysis in ms: about 3.5 ms at 640 x 360, 5.2 ms at 1920 x 1080 and 10.4 ms at 3840 x 2160.

Common Settings

info

show manual

Button. Opens the manual page of the selected object (or of its parent module for a control) in the web browser. If no page exists for this object, an error is traced in the trace panel.

For more details about information/help creation, see create-help-file.

description

Free multi-line text attached to the module, saved with the patch. When it is not empty, it is shown as the hint of the module (mouse over the module header in the patch) in place of the default module hint, even when the module hints are disabled.

ID's

visible only in god mode, see setup-panel-tab-expert.

unique ID

Read-only, not saved. Current private numeric ID of the object, used internally to identify it (for example as the target of a bind ID).

preset ID

Read-only, not saved. Private ID used to store and recall the values of this control in presets.

recreate ID

Button. Generates a new unique ID, original ID and preset ID for the object. Use it if you experience difficulties in Polyphonic mode or if two objects share the same ID. Preset values and binds referring to the old IDs are lost.

Object Remote Address

absolute

Read-only, not saved. Absolute address of the object in the Usine objects tree, built from the workspace root. This is the address to use to reach the object from scripts, the objects panel or remote messages. Only shown for objects that are registered in the objects list. See objects-address.

local

Read-only, not saved. Address of the object relative to the current patch, valid inside that patch only. See objects-address.

user addr

Free user-defined address for the object (empty by default). When set, the object is also registered in the objects tree under this name, so it can be reached independently of its position in the workspace (the value is also reported in the mouse-over and mouse-down chunks). Changing it rebuilds the objects list. Only available on objects that support a user address. See objects-address.

See also

version 7.0.250921

Edit All Pages