MP_FaceMesh_V2 is a pytorch port of tensorfolow
FaceMeshV2
model from Google's
mediapipe
library.
The model takes a cropped 2D face with 25% margin on each side resized to 256 x 256 pixels and outputs a dense 473 landmark coordinates in a 3D (x,y,z) coordinate space.
The original tensorflow model was ported to ONNX and then to pytorch using
onnx2torch
. Currently, we are serializing the converted model, which requires onnx2torch as a dependency.
If you use the mp_facemesh_v2 model in your research or application, please cite the following paper:
Grishchenko, I., Ablavatski, A., Kartynnik, Y., Raveendran, K., & Grundmann, M. (2020). Attention mesh: High-fidelity face mesh prediction in real-time. arXiv preprint arXiv:2006.10962.
@misc{grishchenko2020attentionmeshhighfidelityface,
title={Attention Mesh: High-fidelity Face Mesh Prediction in Real-time},
author={Ivan Grishchenko and Artsiom Ablavatski and Yury Kartynnik and Karthik Raveendran and Matthias Grundmann},
year={2020},
eprint={2006.10962},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2006.10962},
}
Example Useage
import torch
from huggingface_hub import hf_hub_download
device = 'cpu'# Load model and weights
landmark_model_file = hf_hub_download(repo_id='py-feat/mp_facemesh_v2', filename="face_landmarks_detector_Nx3x256x256_onnx.pth")
landmark_detector = torch.load(landmark_model_file, map_location=device, weights_only=False)
landmark_detector.eval()
landmark_detector.to(device)
# Test model
face_image = "path/to/your/test_image.jpg"# Replace with your extracted face image that is [224, 224]# Extract Landmarks
landmark_results = landmark_detector(torch.tensor(face_image).to(device))
Runs of py-feat mp_facemesh_v2 on huggingface.co
0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs
More Information About mp_facemesh_v2 huggingface.co Model
mp_facemesh_v2 huggingface.co is an AI model on huggingface.co that provides mp_facemesh_v2's model effect (), which can be used instantly with this py-feat mp_facemesh_v2 model. huggingface.co supports a free trial of the mp_facemesh_v2 model, and also provides paid use of the mp_facemesh_v2. Support call mp_facemesh_v2 model through api, including Node.js, Python, http.
mp_facemesh_v2 huggingface.co is an online trial and call api platform, which integrates mp_facemesh_v2's modeling effects, including api services, and provides a free online trial of mp_facemesh_v2, you can try mp_facemesh_v2 online for free by clicking the link below.
py-feat mp_facemesh_v2 online free url in huggingface.co:
mp_facemesh_v2 is an open source model from GitHub that offers a free installation service, and any user can find mp_facemesh_v2 on GitHub to install. At the same time, huggingface.co provides the effect of mp_facemesh_v2 install, users can directly use mp_facemesh_v2 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.