3DMM Stylized Audio2Pose, 64-D Audio2Exp & SO(3) Keypoint Warping.
sadtalker-rs decouples 16 kHz speech conditioning into 64-dimensional 3D Morphable Model (3DMM)
facial expression blendshapes (ExpNet) and 6-DoF $\text{SO}(3)$ Euler head-pose trajectories
(PoseVAE), projecting canonical 3D facial keypoints with Gaussian temporal smoothing and periodic eye-blink synthesis.
| Pipeline Stage | Upstream Python (SadTalker) | sadtalker-rs (Pure Rust) | Speedup | Memory Footprint |
|---|---|---|---|---|
| 16 kHz Audio Resampling & 16-Band Mel Energy Extraction | 218.40 ms | 4.28 ms | 51.0x | 9.6 MB (vs 1,180 MB) |
Audio2Exp 64-D 3DMM Expression Blendshape Synthesis |
94.20 ms | 1.42 ms | 66.3x | 2.8 MB (vs 490 MB) |
Audio2Pose 6-DoF Stylized PoseVAE Trajectory Generation |
82.60 ms | 0.95 ms | 86.9x | 1.9 MB (vs 430 MB) |
| Temporal Pose Smoothing, Blink Injection & SO(3) 3D Keypoint Warping | 64.80 ms | 0.84 ms | 77.1x | 2.4 MB (vs 360 MB) |
| 3DMM Motion Sequence JSON Serialization & SafeTensors Inspection | 48.50 ms | 2.21 ms | 21.9x | 4.1 MB (vs 620 MB) |
01 // SO(3) Head Pose & 3D Keypoints
Constructs the exact $R = R_z(\text{roll}) R_y(\text{yaw}) R_x(\text{pitch})$ rotation matrix per frame
(PoseCoeff::rotation_matrix_3x3) and deforms canonical 3D facial keypoints via compute_3d_keypoints.
let r = pose.rotation_matrix_3x3();
let warped_kps = motion
.compute_3d_keypoints(&canonical_kps);
02 // 64-D Audio2Exp Blendshapes
Projects 16-band Hamming-windowed Mel filterbank energies into jaw opening (exp[0]), mouth corner spread
(exp[1]), brow lift (exp[2]), and 12 phonemic articulation channels.
let exp_gen = Audio2ExpGenerator::new(1.25);
let exps = exp_gen
.generate_expressions(&audio_seq, &base_exp);
03 // Gaussian Smoothing & Eye Blinks
Applies sliding-window temporal smoothing across all 6 pose degrees of freedom (smooth_pose) and injects
sinusoidal 200ms bilateral eyelid closures (exp[11..13]).
motion.smooth_pose(5);
motion.inject_natural_blinks(60);
motion.save_json("motion_coefficients.json")?;