3D Face Landmarker - MediaPipe-based face landmark detection
Project description
MVMP: 3D Multi-View MediaPipe
Description
MVMP (Multi-View MediaPipe) is a lightweight software designed for the 3D localization of facial landmarks starting from a static textured mesh. It generates multiple orthographic projections of the face mesh, estimates 2D landmarks using MediaPipe, and backprojects them into 3D space through a consensus-based method. The result is a robust prediction of 478 facial landmarks directly aligned with the 3D mesh geometry.
This method enables landmark estimation even without original scanning data or active vision systems, offering an efficient and flexible approach for 3D face modeling, recognition, and analysis.
Table of Contents
Installation
To install and set up the project, follow these steps:
-
Ensure you have Python 3.11 installed.
-
Create and activate a virtual environment (optional but recommended):
python3.11 -m venv myenv source myenv/bin/activate # On Linux/macOS myenv\Scripts\activate # On Windows
-
Install the required packages:
pip install -r requirements.txt
-
Download the MediaPipe Face Landmarker model:
wget https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/latest/face_landmarker.task
Usage
The main entry point for the program is predict.py.
You can run it with:
python predict.py --help
It accepts the following optional arguments:
optional arguments:
-h, --help Show this help message and exit.
-f, --folder Indicates that the input path is a root folder that will be accessed recursively to find .obj files.
-p PROJECTIONS_NUMBER, --projections-number PROJECTIONS_NUMBER
Number of projections to be calculated. Default is 500.
-o OUTPUT_PATH, --output-path OUTPUT_PATH
Optional. If set, results will be saved to this path. Otherwise, they will be saved inside the .obj file folder.
-r, --render If set, renders the results in an external window.
Output
For each processed mesh, a <mesh>_landmarks.json file will be generated inside the corresponding mesh's folder (or the specified output folder if --output-path is used).
The JSON file contains:
- The normalized coordinates of the estimated 478 landmarks.
- The index of the closest mesh vertex for each landmark.
Results
Contributing
We welcome contributions! To contribute:
- Fork the repository and create a feature branch.
- Make your changes with clear and descriptive commit messages.
- Push the branch to your fork.
- Open a pull request describing your changes.
License
This project is licensed under the MIT License.
Contact
If you have any questions or suggestions, feel free to get in touch!
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 face_landmarker_3d-1.0.1.tar.gz.
File metadata
- Download URL: face_landmarker_3d-1.0.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12d6de811a95ee89df84d447e48e9f98782ec69f993fa4291d45a5603907ad2a
|
|
| MD5 |
ce8b52bf1b985cc3a7d94074a9922675
|
|
| BLAKE2b-256 |
94bc351f1cb8e2685b5ce1d097c0d06a6504ced930038a1360a55f24248c72df
|
File details
Details for the file face_landmarker_3d-1.0.1-py3-none-any.whl.
File metadata
- Download URL: face_landmarker_3d-1.0.1-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43f13ac4dbe351fe539f44a01be326a03cc0ddaf206d009f845b36e453aceeb9
|
|
| MD5 |
c205a70876d6a59efe1bb9375a0ad04a
|
|
| BLAKE2b-256 |
f6f4d572833216326a8c4282dafc4f89f2d7b0134ae239178250720682c7c9b8
|