Facial Expression Detection
Overview
Facial Expression Detection node classifies facial expressions for detected faces and returns an overlay, a summed expression score, and enriched face attributes.
Connect faces from Face Detection. OpenCV Face Expression Recognition does not include contempt; UniFace AffecNet8 supports the full expression set.
Input
Input Image
image requiredThe image frame to analyze. Connect this to a camera or upstream image output.
Detected Faces
array requiredList of faces detected in the frame. Each object must include at least a Bounding Box (bbox: [x, y, width, height]). Label, Confidence, and Extra Data use defaults when missing.
Facial Expression Model
string required advancedModel used for facial expression classification.
Values:
ONUF_AFFECNET8(default) — UniFace: AffecNet8ONCV_FACE_EXPR_RECOG— OpenCV: Face Expression Recognition
Confidence threshold
number required advancedMinimum confidence score to keep a prediction. See Confidence Threshold for tuning guidance.
Range: 0.0 to 1.0
Default: 0.5
Minimum Face Size
array required advancedMinimum [width, height] of a face box for expression detection.
Default: [25, 25]
Add attributes to person
boolean advancedWhen enabled, also adds expression attributes to the parent person object that contains the face.
Default: true
Use TensorRT if available
boolean required advancedEnable TensorRT inference backend when available. Can improve throughput on NVIDIA GPUs.
Default: false
Expression Score Map
object advancedNumeric score mapping used when summing expression scores. Defaults:
- Neutral:
0 - Happy:
1 - Sad:
-1 - Surprised:
2 - Fear:
-3 - Disgusted:
-2 - Angry:
-3 - Contempt:
-2
Overlay results
boolean required advancedWhether to draw results on the output frame. See Overlay Results.
Default: true
Output
Overlay Image
imageFrame with expression overlays when overlay is enabled.
Summed Expression Scores
numberSum of mapped expression scores for faces in the current frame.
Detected Faces
arrayEnriched face detections. Each object includes the original fields plus:
- Facial Expression —
neutral,happy,sad,surprised,fear,disgusted,angry,contempt, orunknown - Expression Score