Image Classification
Py-Feat
facial-expression-analysis
action-units
emotion-recognition
gaze-estimation
face-landmarks
head-pose
blendshapes
multitask
Instructions to use py-feat/face_multitask_v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Py-Feat
How to use py-feat/face_multitask_v2 with Py-Feat:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -21,16 +21,17 @@ A single multi-task convolutional model for facial behavior analysis, used by
|
|
| 21 |
[py-feat](https://github.com/cosanlab/py-feat)'s `Detectorv2`. From one face crop
|
| 22 |
it jointly predicts **action units, categorical emotion, valence/arousal,
|
| 23 |
eye gaze, a 478-point face mesh, 6-DoF head pose, and 52 MediaPipe/ARKit
|
| 24 |
-
blendshapes** (the v2.
|
| 25 |
|
| 26 |
- **Backbone:** ConvNeXt-V2 Tiny (FCMAE + IN-22k/IN-1k pretrained)
|
| 27 |
- **Heads:** ME-GraphAU AU graph (AFG/FGG/SC) + unified-feature emotion/V-A heads
|
| 28 |
+ landmark, pose, and **blendshape** regression heads + the v2.6 **eye-aware
|
| 29 |
gaze head**: RoI-pooled eye features (localized by the predicted mesh),
|
| 30 |
conditioned on predicted head pose (6D), with an L2CS-style binned prediction
|
| 31 |
-
over the full ±180° range
|
| 32 |
-
- **Params:** ~
|
| 33 |
-
- **File:** `
|
|
|
|
| 34 |
|
| 35 |
## Outputs
|
| 36 |
|
|
@@ -45,32 +46,41 @@ blendshapes** (the v2.6 model; replaces v2.5).
|
|
| 45 |
| 68 landmarks | derived | dlib-68 subset sampled from the 478 mesh |
|
| 46 |
| Blendshapes | 52 coefficients [0,1] | MediaPipe/ARKit standard names (browInnerUp, jawOpen, mouthSmileLeft, …) |
|
| 47 |
|
| 48 |
-
## Benchmarks (held-out, file-verified — v2.
|
| 49 |
|
| 50 |
All gaze splits are identity-disjoint from training (held-out subjects), and
|
| 51 |
EYEDIAP is never trained on by any py-feat model.
|
| 52 |
|
| 53 |
-
| Task | Dataset | Metric | v2.6 | v2.5 |
|
| 54 |
-
|---|---|---|---|---|
|
| 55 |
-
| AU | DISFA+ (12-AU, Cheong protocol) | macro-F1 | **0.696** | 0.693 |
|
| 56 |
-
| AU | DISFA+ (8-AU subset) | macro-F1 | 0.738 | **0.740** |
|
| 57 |
-
| Emotion | AffectNet val (7-cls, drop Contempt) | acc / macro-F1 | 0.615 / 0.610 | **0.616 / 0.612** |
|
| 58 |
-
|
|
| 59 |
-
|
|
| 60 |
-
|
|
| 61 |
-
|
|
| 62 |
-
| Gaze |
|
| 63 |
-
| Gaze |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
-
Notes: **v2.
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
## Usage
|
| 76 |
|
|
|
|
| 21 |
[py-feat](https://github.com/cosanlab/py-feat)'s `Detectorv2`. From one face crop
|
| 22 |
it jointly predicts **action units, categorical emotion, valence/arousal,
|
| 23 |
eye gaze, a 478-point face mesh, 6-DoF head pose, and 52 MediaPipe/ARKit
|
| 24 |
+
blendshapes** (the v2.7 model; replaces v2.6).
|
| 25 |
|
| 26 |
- **Backbone:** ConvNeXt-V2 Tiny (FCMAE + IN-22k/IN-1k pretrained)
|
| 27 |
- **Heads:** ME-GraphAU AU graph (AFG/FGG/SC) + unified-feature emotion/V-A heads
|
| 28 |
+ landmark, pose, and **blendshape** regression heads + the v2.6 **eye-aware
|
| 29 |
gaze head**: RoI-pooled eye features (localized by the predicted mesh),
|
| 30 |
conditioned on predicted head pose (6D), with an L2CS-style binned prediction
|
| 31 |
+
over the full ±180° range (v2.7: 2° bins)
|
| 32 |
+
- **Params:** ~42M · **Input:** 224×224 RGB (from a 256×256 face crop)
|
| 33 |
+
- **File:** `face_multitask_v27.safetensors` (safetensors; `ModelV2Config` JSON in the file metadata)
|
| 34 |
+
- **Weights:** soup (equal average) of five consecutive fine-tuning checkpoints
|
| 35 |
|
| 36 |
## Outputs
|
| 37 |
|
|
|
|
| 46 |
| 68 landmarks | derived | dlib-68 subset sampled from the 478 mesh |
|
| 47 |
| Blendshapes | 52 coefficients [0,1] | MediaPipe/ARKit standard names (browInnerUp, jawOpen, mouthSmileLeft, …) |
|
| 48 |
|
| 49 |
+
## Benchmarks (held-out, file-verified — v2.7 deployed checkpoint)
|
| 50 |
|
| 51 |
All gaze splits are identity-disjoint from training (held-out subjects), and
|
| 52 |
EYEDIAP is never trained on by any py-feat model.
|
| 53 |
|
| 54 |
+
| Task | Dataset | Metric | v2.7 | v2.6 | v2.5 |
|
| 55 |
+
|---|---|---|---|---|---|
|
| 56 |
+
| AU | DISFA+ (12-AU, Cheong protocol) | macro-F1 | 0.686 | **0.696** | 0.693 |
|
| 57 |
+
| AU | DISFA+ (8-AU subset) | macro-F1 | **0.740** | 0.738 | **0.740** |
|
| 58 |
+
| Emotion | AffectNet val (7-cls, drop Contempt) | acc / macro-F1 | 0.612 / 0.607 | 0.615 / 0.610 | **0.616 / 0.612** |
|
| 59 |
+
| Emotion | RAF-DB test | acc / macro-F1 | 0.876 / 0.817 | 0.873 / 0.818 | **0.910 / 0.885** |
|
| 60 |
+
| Valence/Arousal | AffectNet val | CCC (V / A) | 0.773 / 0.647 | 0.775 / **0.653** | **0.780** / 0.646 |
|
| 61 |
+
| Valence/Arousal | AFEW-VA | CCC (V / A) | 0.711 / 0.480 | 0.718 / 0.411 | **0.833 / 0.863** |
|
| 62 |
+
| Valence/Arousal | Aff-Wild2 val | CCC (V / A) | 0.331 / 0.418 | 0.397 / 0.458 | **0.852 / 0.799** |
|
| 63 |
+
| Gaze | ETH-XGaze (held-out subjects) | mean angular err | 5.1° | **5.0°** | 43.2° |
|
| 64 |
+
| Gaze | EYEDIAP (never-train, 15.2K frames) | mean angular err | **12.6°** | 13.4° | 15.3° |
|
| 65 |
+
| Gaze | Gaze360 (held-out split) | mean angular err | 13.0° | 13.0° | **12.9°** |
|
| 66 |
+
| Gaze | MPIIGaze (leave-subject-out) | mean angular err | 8.0° | 7.4° | **7.0°** |
|
| 67 |
+
| Gaze | Columbia (held-out subjects) | mean angular err | **4.1°** | 5.4° | — (trained) |
|
| 68 |
+
| Blendshapes | FacePlace (teacher agreement) | mean active-ch. r | **0.761** | 0.748 | 0.756 |
|
| 69 |
|
| 70 |
+
Notes: **v2.7 = the v2.6 architecture retrained** with a rescaled gaze loss,
|
| 71 |
+
a rebalanced within-gaze data mix, per-source augmentation, 2° gaze bins, and
|
| 72 |
+
a head-pose label fix. Vs v2.6 it improves out-of-distribution gaze (EYEDIAP
|
| 73 |
+
−0.7°, Columbia −1.3°), RAF-DB macro-F1 end-to-end (+2.7), AFEW-VA arousal,
|
| 74 |
+
blendshape fidelity (best of any release), and occlusion robustness, at the
|
| 75 |
+
cost of ~0.6° on frontal MPIIGaze and 0.01 on the 12-AU set.
|
| 76 |
+
|
| 77 |
+
**Known limitation (v2.6 and v2.7):** continuous valence/arousal on
|
| 78 |
+
*video-frame* corpora (Aff-Wild2, AFEW-VA) is substantially below v2.5
|
| 79 |
+
(e.g. Aff-Wild2 CCC-V 0.85 → 0.33). AffectNet (still-image) V/A is unaffected.
|
| 80 |
+
If frame-wise continuous V/A on video is your primary measure, prefer the v2.5
|
| 81 |
+
weights (`face_multitask_v2.safetensors`, still published in this repo). A fix
|
| 82 |
+
is under investigation. Numbers are from the deployed checkpoint (v2.7
|
| 83 |
+
stage-3 soup ep05-09), weight-verified against the published `.safetensors`.
|
| 84 |
|
| 85 |
## Usage
|
| 86 |
|