Metadata-Version: 2.4
Name: face-landmarker-3d
Version: 1.0.0
Summary: 3D Face Landmarker - MediaPipe-based face landmark detection
Requires-Python: <3.12,>=3.11
Description-Content-Type: text/markdown
Requires-Dist: absl-py==2.2.1
Requires-Dist: addict==2.4.0
Requires-Dist: asttokens==3.0.0
Requires-Dist: attrs==25.3.0
Requires-Dist: blinker==1.9.0
Requires-Dist: certifi==2025.1.31
Requires-Dist: cffi==1.17.1
Requires-Dist: charset-normalizer==3.4.1
Requires-Dist: click==8.1.8
Requires-Dist: comm==0.2.2
Requires-Dist: configargparse==1.7
Requires-Dist: contourpy==1.3.2
Requires-Dist: cycler==0.12.1
Requires-Dist: dash==3.0.1
Requires-Dist: decorator==5.2.1
Requires-Dist: executing==2.2.0
Requires-Dist: fastjsonschema==2.21.1
Requires-Dist: filelock==3.18.0
Requires-Dist: flask==3.0.3
Requires-Dist: flatbuffers==25.2.10
Requires-Dist: fonttools==4.57.0
Requires-Dist: fsspec==2025.3.2
Requires-Dist: idna==3.10
Requires-Dist: importlib-metadata==8.6.1
Requires-Dist: ipython==9.0.2
Requires-Dist: ipython-pygments-lexers==1.1.1
Requires-Dist: ipywidgets==8.1.5
Requires-Dist: itsdangerous==2.2.0
Requires-Dist: jax==0.5.3
Requires-Dist: jaxlib==0.5.3
Requires-Dist: jedi==0.19.2
Requires-Dist: jinja2==3.1.6
Requires-Dist: joblib==1.4.2
Requires-Dist: jsonschema==4.23.0
Requires-Dist: jsonschema-specifications==2024.10.1
Requires-Dist: jupyter-core==5.7.2
Requires-Dist: jupyterlab-widgets==3.0.13
Requires-Dist: kiwisolver==1.4.8
Requires-Dist: llvmlite==0.44.0
Requires-Dist: markupsafe==3.0.2
Requires-Dist: matplotlib==3.10.1
Requires-Dist: matplotlib-inline==0.1.7
Requires-Dist: mediapipe==0.10.14
Requires-Dist: ml-dtypes==0.5.1
Requires-Dist: mpmath==1.3.0
Requires-Dist: narwhals==1.37.0
Requires-Dist: nbformat==5.10.4
Requires-Dist: nest-asyncio==1.6.0
Requires-Dist: networkx==3.4.2
Requires-Dist: numba==0.61.0
Requires-Dist: numpy==1.25.0
Requires-Dist: numpy-quaternion==2024.0.7
Requires-Dist: nvidia-cublas-cu12==12.4.5.8
Requires-Dist: nvidia-cuda-cupti-cu12==12.4.127
Requires-Dist: nvidia-cuda-nvrtc-cu12==12.4.127
Requires-Dist: nvidia-cuda-runtime-cu12==12.4.127
Requires-Dist: nvidia-cudnn-cu12==9.1.0.70
Requires-Dist: nvidia-cufft-cu12==11.2.1.3
Requires-Dist: nvidia-curand-cu12==10.3.5.147
Requires-Dist: nvidia-cusolver-cu12==11.6.1.9
Requires-Dist: nvidia-cusparse-cu12==12.3.1.170
Requires-Dist: nvidia-cusparselt-cu12==0.6.2
Requires-Dist: nvidia-nccl-cu12==2.21.5
Requires-Dist: nvidia-nvjitlink-cu12==12.4.127
Requires-Dist: nvidia-nvtx-cu12==12.4.127
Requires-Dist: open3d==0.18.0
Requires-Dist: opencv-contrib-python==4.11.0.86
Requires-Dist: opt-einsum==3.4.0
Requires-Dist: packaging==25.0
Requires-Dist: pandas==2.2.3
Requires-Dist: parso==0.8.4
Requires-Dist: pexpect==4.9.0
Requires-Dist: pillow==11.1.0
Requires-Dist: platformdirs==4.3.7
Requires-Dist: plotly==6.0.1
Requires-Dist: prompt-toolkit==3.0.50
Requires-Dist: protobuf==4.25.6
Requires-Dist: ptyprocess==0.7.0
Requires-Dist: pure-eval==0.2.3
Requires-Dist: pycparser==2.22
Requires-Dist: pygments==2.19.1
Requires-Dist: pyparsing==3.2.3
Requires-Dist: pyquaternion==0.9.9
Requires-Dist: python-dateutil==2.9.0.post0
Requires-Dist: pytz==2025.2
Requires-Dist: pyyaml==6.0.2
Requires-Dist: referencing==0.36.2
Requires-Dist: requests==2.32.3
Requires-Dist: retrying==1.3.4
Requires-Dist: rpds-py==0.24.0
Requires-Dist: scikit-learn==1.6.1
Requires-Dist: scipy==1.15.2
Requires-Dist: six==1.17.0
Requires-Dist: sounddevice==0.5.1
Requires-Dist: stack-data==0.6.3
Requires-Dist: sympy==1.13.1
Requires-Dist: threadpoolctl==3.6.0
Requires-Dist: tqdm==4.67.1
Requires-Dist: traitlets==5.14.3
Requires-Dist: triton==3.2.0
Requires-Dist: typing-extensions==4.13.0
Requires-Dist: tzdata==2025.2
Requires-Dist: urllib3==2.3.0
Requires-Dist: wcwidth==0.2.13
Requires-Dist: werkzeug==3.0.6
Requires-Dist: widgetsnbextension==4.0.13
Requires-Dist: zipp==3.21.0

# MVMP: 3D Multi-View MediaPipe

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Framework](https://img.shields.io/badge/Framework-Python_3.11-yellow)](https://www.python.org/downloads/release/python-3110/) [![Face Landmarker](https://img.shields.io/badge/Model-MediaPipe_Face_Landmarker-red)](https://developers.google.com/mediapipe/solutions/vision/face_landmarker)

## 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.

<!--![alt text](./img/pipelineOverview.png)-->
<img src="./img/pipelineOverview.png">

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)

## Installation

To install and set up the project, follow these steps:

1. Ensure you have Python 3.11 installed.

2. Create and activate a virtual environment (optional but recommended):

   ```bash
   python3.11 -m venv myenv
   source myenv/bin/activate   # On Linux/macOS
   myenv\Scripts\activate      # On Windows
   ```

3. Install the required packages:

   ```bash
   pip install -r requirements.txt
   ```

4. Download the MediaPipe Face Landmarker model:

   ```bash
   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:

```bash
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
<!--![alt text](./img/results.png)-->
<img src="results.png">

## Contributing

We welcome contributions! To contribute:

1. Fork the repository and create a feature branch.
2. Make your changes with clear and descriptive commit messages.
3. Push the branch to your fork.
4. Open a pull request describing your changes.

## License

This project is licensed under the [MIT License](LICENSE).

## Contact

If you have any questions or suggestions, feel free to get in touch!
