3D Multi-View MediaPipe - Facial landmark detection for 3D meshes
Project description
MVMP: 3D Multi-View MediaPipe
Description
MVMP detects 478 MediaPipe-compatible 3D facial landmarks on textured meshes. It renders the mesh from 5 deterministic zone-based viewpoints (front, left/right sides, upper/lower), detects 2D landmarks with MediaPipe, and back-projects each to the mesh surface via raycasting. An optional Fibonacci-sphere auto-alignment phase orients the face toward +Z before detection.
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
marker = Facemarker()
result = marker.predict("path/to/mesh.obj")
print(result) # FacemarkerResult(478 landmarks, 478 vertex indices)
landmarks_3d = result.landmarks_3d # dict[int, [x, y, z]]
vertex_indices = result.closest_vertices_ids # dict[int, int]
result.save_json("landmarks.json")
Quiet mode / debug output
marker = Facemarker(verbose=False)
# Save per-zone renders and auto-align report
marker = Facemarker(debug_output_dir="debug/")
Camera distance
# Move cameras closer (0.5×) or farther (2×)
marker = Facemarker(camera_distance_multiplier=0.8)
Disable auto-alignment
# Skip Fibonacci-sphere alignment (mesh assumed to already face +Z)
marker = Facemarker(auto_orient=False)
Command Line
mvmp path/to/mesh.obj -o output/
# Process a folder
mvmp meshes/ -o results/
# With debug renders
mvmp mesh.obj --debug debug_output/
# Closer camera, no auto-align
mvmp mesh.obj --camera-distance 0.8 --no-auto-orient
Arguments:
path: Mesh file or directory-o, --output-path: Output directory (default:./output/)--debug: Save debug renders and auto-align report to this directory--camera-distance: Camera distance multiplier (default: 1.0)--no-auto-orient: Skip Fibonacci-sphere auto-alignment
Output Format
{
"coordinates": {"0": [x, y, z], ...},
"closest_vertex_indexes": {"0": 12345, ...}
}
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.1.1.tar.gz.
File metadata
- Download URL: mvmp-1.1.1.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 |
e8f3550b1ce7fdeee42f0eb2c6a2b6a519ad20f1f6cbdd3465d06ce2980de1e4
|
|
| MD5 |
a4b73a1a275fee6ba20cd333cd5a4e3b
|
|
| BLAKE2b-256 |
5799019ed284384beb543e24161b71072dc442c97fe88cd7357e01b7909cdb94
|
File details
Details for the file mvmp-1.1.1-py3-none-any.whl.
File metadata
- Download URL: mvmp-1.1.1-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 |
0f7b4f9bfc1837d93067d4446488ffc939857f59c00715996cfd965998c0c637
|
|
| MD5 |
a9d43b25ebcf682274eb5afdf07918b7
|
|
| BLAKE2b-256 |
0870919e7c07457226927a00e7928d983a90c19633d9c323e4c7049ac0e54330
|