Add emotion_to_mesh and bs_to_mesh PLS visualization models - #369
Open
ljchang wants to merge 4 commits into
Open
Add emotion_to_mesh and bs_to_mesh PLS visualization models#369ljchang wants to merge 4 commits into
ljchang wants to merge 4 commits into
Conversation
Companions to the AU->mesh model: predict the 478-vertex MediaPipe FaceMesh from 7 emotion probabilities or 52 blendshapes + pose, trained on the same CelebV-HQ Detectorv2/MPDetector predictions and aligned into the shared au_to_mesh v5 canonical frame so all three render coherently. - PLSFeatMeshModel + load_emotion_face_mesh_model / load_blendshape_face_mesh_model (lazy hf_hub_download from py-feat/emotion_to_mesh and py-feat/bs_to_mesh) - predict_face_mesh_from_features; plot_face_mesh gains emotion=/blendshapes= - tests (offline stubs + network) OOS variance-weighted R2 (3-fold GroupKFold by video, 633K frames/34.8K videos): emotion 0.206, blendshapes 0.639.
- predict(): clear ValueError on 0-d/scalar input (was cryptic IndexError); slice deployed coef feature rows instead of zero-padding pose channels - plot_face_mesh(emotion=/blendshapes=): accept a single-face (1, n) row - extract shared _flat_to_mesh() helper (AU + feature paths) - tests for the above
The au/emotion/blendshape/mesh inputs are now validated together, so the error text changed from 'either au or mesh' to 'at most one of ...'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds emotion → mesh and blendshape → mesh PLS visualization models as companions to the existing
au_to_meshmodel. They predict the 478-vertex MediaPipe FaceMesh from 7 emotion probabilities or 52 blendshapes (+ pose), trained on the same CelebV-HQ Detectorv2/MPDetector predictions and aligned into the sameau_to_meshv5 canonical frame, so all three render coherently.Weights are hosted on the HF Hub:
API (in
feat.plotting)PLSFeatMeshModel— generic feature+pose → mesh wrapper (mirrorsPLSAUMeshModel)load_emotion_face_mesh_model()/load_blendshape_face_mesh_model()— lazyhf_hub_downloadfrom the repos above, with afeature_columnsdrift guardpredict_face_mesh_from_features(feats, model)→(478, 3)/(n, 478, 3)plot_face_mesh(...)gainsemotion=andblendshapes=kwargs (mutually exclusive withau=/mesh=)Models
Recipe matches
au_to_mesh(Umeyama-Procrustes absolute coords,[feat | pose | feat×pose], full-rank linear ≡ full-rank PLS, linearized tocoef/intercept, pose absorbed at inference). Trained on 633,207 frames / 34,854 videos.Tests
feat/tests/test_feat_mesh_viz.py— 13 offline (stubbed) + 2 network. Existingtest_face_mesh_viz.py(au_to_mesh) still passes.