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

I found that tf models you used in your code is not the same as official tf models #15

Open
hu394854434 opened this issue Sep 2, 2022 · 4 comments

Comments

@hu394854434
Copy link

hu394854434 commented Sep 2, 2022

I don't know if you have done some operation to make your models have the same output as offcial models

@hu394854434 hu394854434 changed the title I found that the models you used in your code is not the I found that tf models you used in your code is not the same as official tf models Sep 2, 2022
@pntt3011
Copy link
Owner

pntt3011 commented Sep 2, 2022

Hi @hu394854434,
My models are downloaded directly from Mediapipe's official repo.
Below are the links to those models, you can use any checksum to verify if they are the same file:

Mediapipe just updated their face landmark model in commit 33d683c, after I created this repo.
The other two models are still the same in their latest commit 63e679d.

@hu394854434
Copy link
Author

Thanks for your answer!And there is another question:
Besides x\y coordinates,I need z coordinates too.I want the same coordinates as the python mediapipe,and I read the model card of landmark.tflite.In this model card,z is scaled with face width,I don't what the face width is.
And I found the Detected Face Roi Width is bigger than the input image width in FaceLandmark.cpp,line 43

@pntt3011
Copy link
Owner

Hi @hu394854434, I'm sorry for my late response.

First, according to Face Mesh doc, I don't think the face landmark model alone can produce the real world distance. Thus, you need to use the Face Transform module mentioned in the Face Mesh doc (sorry but I can't help you with this).

Second, the method getInputShape() is the input shape of the model (not the input image), the face width you need is the roi width (in pixel, of course).

However, with iris landmarks, you can get the depth with the assumption that human iris diameter is roughly 11.7mm (just use thales theorem).

@hu394854434
Copy link
Author

I'm sorry for my late response too.

I try to understand the c++ pipeline of mediapipe(like subgraph caculator etc),and I finally found out how the landmark is normalized here

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