3D Multi-View MediaPipe - Facial landmark detection for 3D meshes
Project description
MVMP: 3D Multi-View MediaPipe
Description
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
Installation
pip install mvmp
The MediaPipe Face Landmarker model is bundled in the package.
From Source
git clone https://github.com/gfacchi-dev/mvmp.git
cd mvmp
pip install .
Usage
Python API
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")
More projections = more accuracy
marker = Facemarker(projections=500)
result = marker.predict("mesh.obj")
Custom camera angles
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")
Process multiple meshes
marker = Facemarker(projections=200)
for mesh_path in mesh_files:
result = marker.predict(mesh_path)
result.save_json(f"output/{mesh_path.stem}.json")
Quiet mode
marker = Facemarker(verbose=False)
result = marker.predict("mesh.obj")
Command Line
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
Output Format
JSON output contains coordinates at the original mesh scale:
{
"coordinates": [[x, y, z], ...],
"closest_vertex_indexes": [idx1, idx2, ...]
}
Results
Contributing
- Fork the repository and create a feature branch.
- Make your changes with clear commit messages.
- Open a pull request.
License
Contact
Questions or suggestions? Open an issue on GitHub.
Project details
Release history Release notifications | RSS feed
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 mvmp-1.0.0.tar.gz.
File metadata
- Download URL: mvmp-1.0.0.tar.gz
- Upload date:
- Size: 3.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f66b7cc013bcd780025fa06b54816757afddcb231736d390a1426f612f77dbba
|
|
| MD5 |
9f96d9205b35d1d2b777e5d8e7ef51de
|
|
| BLAKE2b-256 |
93b5b291e0e361631d0e7730bcbe53c1245f712a3a4f6fa2e284ff41558dbcf0
|
File details
Details for the file mvmp-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mvmp-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7cb8bd925e238c382e81f1ba10a2c8f009ad0626a55e9250cdd792068ab599d7
|
|
| MD5 |
687dacbcf036a5ce9b401937653f4f6e
|
|
| BLAKE2b-256 |
5edaf347e6b63040f596c4d32a9b13b3c1adf27e224f68cf51ada7327e3393ed
|