Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to fit custom mesh #1

Open
zw20045500 opened this issue Aug 3, 2022 · 1 comment
Open

How to fit custom mesh #1

zw20045500 opened this issue Aug 3, 2022 · 1 comment

Comments

@zw20045500
Copy link

in code you use canonical_face_model.obj(mediapipe defined), if i want to use my custom face mesh, how to do it by mediapipe, thank you

@apple2373
Copy link
Owner

apple2373 commented Oct 26, 2023

I don't believe you can achieve this easily with Mediapipe. Mediapipe is trained to detect 3D landmarks that correspond to the 468 vertices in its predefined mesh (canonical_face_model.obj). To detect 3D landmarks for your own custom face mesh, you would likely need to train another neural network to do so. This means you have to start with preparing training data, etc.

This is what they say about how they trained the model.

For 3D face landmarks we employed transfer learning and trained a network with several objectives: the network simultaneously predicts 3D landmark coordinates on synthetic rendered data and 2D semantic contours on annotated real-world data. The resulting network provided us with reasonable 3D landmark predictions not just on synthetic but also on real-world data.
(source: https://github.com/google/mediapipe/blob/e7121e4feb986bc067c879c954051f8c6cf1eaa2/docs/solutions/face_mesh.md)

They used synthetic data so you may be able to do something similar if you can render realistic faces of your custom mesh. You can also check their paper for details: https://arxiv.org/abs/1907.06724 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants