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.
1import numpy as np
2m = np.load("bs_to_mesh_pls_v5.npz")
3f = np.zeros(len(m["feature_columns"]))
4# e.g. f[m["feature_columns"].tolist().index("happiness")] = 1.0
5pose = np.zeros(3) # [Pitch, Yaw, Roll]
6x = np.concatenate([f, pose]) # (55,)
7flat = x @ m["coef"] + m["intercept"] # (1434,)
8mesh = 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).