Downloads · 30 days
0
py-feat/bs_to_mesh
bs_to_mesh is a machine learning model from py-feat. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for py-feat.
Downloads · 30 days
0
Access
Public
Updated Jun 27, 2026
Repo size
4.1 MB
Likes
0
Public
Click a slice to open those files.
.png3.8 MB · 92%
From the Hugging Face model README

Full-rank linear regression mapping 52 blendshape features + 3 pose covariates
(Pitch, Yaw, Roll) to 478×3 = 1434 MediaPipe FaceMesh vertex coordinates in a
pose-canonical (Procrustes-aligned) frame. Companion to au_to_mesh_pls — same
recipe and SHARED mesh frame, so AU / emotion / blendshape mesh predictions are
mutually consistent for visualization.
import numpy as np
m = np.load("bs_to_mesh_pls_v5.npz")
f = np.zeros(len(m["feature_columns"]))
# e.g. f[m["feature_columns"].tolist().index("happiness")] = 1.0
pose = np.zeros(3) # [Pitch, Yaw, Roll]
x = np.concatenate([f, pose]) # (55,)
flat = x @ m["coef"] + m["intercept"] # (1434,)
mesh = np.stack([flat[:478], flat[478:956], flat[956:]], axis=1) # (478,3) axis-major
NPZ: coef (55, 1434) f32; intercept (1434,) f32; input_columns; feature_columns; feature_name; pose_columns; mean_aligned_mesh (478,3); mean_neutral_mesh (478,3); reference_anchors (12,3); anchor_indices (12,); n_components (); model_card; training_metadata (JSON).