MVMP (Multi-View MediaPipe) is a lightweight tool for 3D facial landmark detection on static textured meshes. It renders multiple camera views of the mesh, detects 2D landmarks with MediaPipe, and backprojects them into 3D space through DBSCAN-based consensus triangulation. The result is 478 facial landmarks aligned with the 3D mesh geometry, with robust outlier rejection.
Supported mesh formats: .obj, .ply, .stl, .gltf, .glb, .off
pip install mvmpThe MediaPipe Face Landmarker model is bundled in the package.
git clone https://github.com/gfacchi-dev/mvmp.git
cd mvmp
pip install .from mvmp import Facemarker
# Create a detector
marker = Facemarker()
# Detect landmarks on a mesh
result = marker.predict("path/to/mesh.obj")
print(result) # FacemarkerResult(478 landmarks, 478 vertex indices)
# Access results
landmarks_3d = result.landmarks_3d # list of [x, y, z] coordinates (original scale)
vertex_indices = result.closest_vertices_ids # closest mesh vertex per landmark
# Save to JSON
result.save_json("landmarks.json")marker = Facemarker(projections=500)
result = marker.predict("mesh.obj")Instead of random projections, specify exact (yaw, pitch) angles in degrees:
marker = Facemarker(camera_angles=[
(0, 0), # front view
(30, 0), # 30 degrees right
(-30, 0), # 30 degrees left
(0, -20), # looking up
(0, 15), # looking down
])
result = marker.predict("mesh.obj")marker = Facemarker(projections=200)
for mesh_path in mesh_files:
result = marker.predict(mesh_path)
result.save_json(f"output/{mesh_path.stem}.json")marker = Facemarker(verbose=False)
result = marker.predict("mesh.obj")mvmp path/to/mesh.obj -p 100 -o output/
# Process all mesh files in a directory (supports .obj, .ply, .stl, .gltf, .glb, .off)
mvmp meshes/ -p 200 -o results/Arguments:
path: Path to mesh file or directory-p, --projections-number: Number of projections (default: 500)-o, --output-path: Output directory
JSON output contains coordinates at the original mesh scale:
{
"coordinates": [[x, y, z], ...],
"closest_vertex_indexes": [idx1, idx2, ...]
}- Fork the repository and create a feature branch.
- Make your changes with clear commit messages.
- Open a pull request.
Questions or suggestions? Open an issue on GitHub.

