Automatic 3D facial template registration via MVMP + MeshMonk
Project description
AutoFaceMonker
Automatic 3D facial template registration using MVMP landmark detection and MeshMonk nonrigid surface registration.
Given a template mesh and a target 3D face scan, AutoFaceMonker detects 478 MediaPipe facial landmarks via MVMP, aligns the template with Procrustes analysis, then refines the fit with MeshMonk nonrigid registration — no manual intervention required.
Installation
pip install autofacemonker
Requires Python ≥ 3.11.
Quick Start
autofacemonker subject.obj -o warped.ply
This uses the bundled template mesh and built-in 7-point anatomical landmark correspondences.
Python API
from autofacemonker import AutoFaceMonker
# Use default template and correspondences
monker = AutoFaceMonker()
warped_vertices = monker.register("subject.obj", save_path="warped.ply")
Custom template and correspondences
monker = AutoFaceMonker(
template="my_template.ply",
correspondences=[
(0, 3572), # nasion → template vertex 3572
(4, 3589), # nose tip → template vertex 3589
(133, 2436), # left eye → template vertex 2436
(362, 4648), # right eye → template vertex 4648
(61, 2310), # left mouth → template vertex 2310
(291, 4849), # right mouth → template vertex 4849
(152, 3543), # chin → template vertex 3543
],
num_iterations=200,
)
warped = monker.register("subject.obj")
CLI
usage: autofacemonker <target.obj> [options]
positional arguments:
target Path to target .obj mesh
options:
-t, --template Template mesh path (default: bundled template.ply)
-c, --correspondences
JSON file with landmark→vertex mapping
-o, --out Output PLY path (default: <target>_warped.ply)
-n, --iterations MeshMonk nonrigid iterations (default: 120)
Correspondence JSON format
{"0": 3572, "4": 3589, "133": 2436, "362": 4648, "61": 2310, "291": 4849, "152": 3543}
How It Works
-
MVMP detects 478 MediaPipe facial landmarks on the target mesh using multi-view 2D projections with 5 zone cameras.
-
Procrustes rigidly aligns the template using the 7 anatomical landmark correspondences, computing rotation, translation, and uniform scale.
-
MeshMonk nonrigid refines the fit by deforming the template to match the target surface over 120 iterations.
Requirements
- Python ≥ 3.11
- meshmonk ≥ 0.3.0
- mvmp ≥ 1.3.0
- trimesh
- numpy
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file autofacemonker-0.1.6.tar.gz.
File metadata
- Download URL: autofacemonker-0.1.6.tar.gz
- Upload date:
- Size: 157.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56d00da95f471c33f41cced66625af07132487b5ee793b812fb99aafa49c4288
|
|
| MD5 |
191e9a81d7fd4b64adcf6799a229a467
|
|
| BLAKE2b-256 |
ab501758de662bc7f3d0af1cb9ff553062d90c0e5c50f820e52036b91000c30d
|
Provenance
The following attestation bundles were made for autofacemonker-0.1.6.tar.gz:
Publisher:
publish.yml on gfacchi-dev/AutoFaceMonker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
autofacemonker-0.1.6.tar.gz -
Subject digest:
56d00da95f471c33f41cced66625af07132487b5ee793b812fb99aafa49c4288 - Sigstore transparency entry: 1549744108
- Sigstore integration time:
-
Permalink:
gfacchi-dev/AutoFaceMonker@806dd0c0768d087e537c05241a6db62801d2c13d -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/gfacchi-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@806dd0c0768d087e537c05241a6db62801d2c13d -
Trigger Event:
push
-
Statement type:
File details
Details for the file autofacemonker-0.1.6-py3-none-any.whl.
File metadata
- Download URL: autofacemonker-0.1.6-py3-none-any.whl
- Upload date:
- Size: 153.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b10b42ca65a176b8fc57bb09084652f9c131ccd081fc3c952d84038918db2b80
|
|
| MD5 |
c2796a4a5bef616951c4b95866521939
|
|
| BLAKE2b-256 |
d3486ea359c2edfd5430df9ddb9633b1f459103f04b6e7e645540ee308be2595
|
Provenance
The following attestation bundles were made for autofacemonker-0.1.6-py3-none-any.whl:
Publisher:
publish.yml on gfacchi-dev/AutoFaceMonker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
autofacemonker-0.1.6-py3-none-any.whl -
Subject digest:
b10b42ca65a176b8fc57bb09084652f9c131ccd081fc3c952d84038918db2b80 - Sigstore transparency entry: 1549744222
- Sigstore integration time:
-
Permalink:
gfacchi-dev/AutoFaceMonker@806dd0c0768d087e537c05241a6db62801d2c13d -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/gfacchi-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@806dd0c0768d087e537c05241a6db62801d2c13d -
Trigger Event:
push
-
Statement type: