Closed YongHe999 closed 2 years ago
Can't find that face_model_landmarks_triangles.txt. But as i checked canonical_face_model.obj and geometry_pipeline_metadata_landmarks.pbtxt. Both files are coincident with canonical_face_model_uv_visualization.png. I can also construct the exactly the same image as canonical_face_model_uv_visualization.png from canonical_face_model.obj.
the 1st triangle's vertex indices are { 174, 156, 134 } (note obj file uses one-indexed) https://github.com/google/mediapipe/blob/63e679d99ca45b30514a9d84c9351a2d77bb9ba0/mediapipe/modules/face_geometry/data/canonical_face_model.obj#L937
compare to the 1st first triangle indices { 173, 155, 133 } (zero-indexed) https://github.com/google/mediapipe/blob/63e679d99ca45b30514a9d84c9351a2d77bb9ba0/mediapipe/modules/face_geometry/data/geometry_pipeline_metadata_landmarks.pbtxt#L2392-L2394
There may be some problems with my expression, the grid displayed by the sample code on Python Colab is as follows,
canonical_face_model_uv_visualization.png is as follows,It is obvious that the meshing in the forehead is different。
As for face_model_landmarks_triangles.txt, it's in https://github.com/google/mediapipe/pull/3419/files, just a list of grid indices。It's just that the division is different, and when I look at face_mesh_connections.py, I see that its result is in line with the first picture. Maybe these references need to be unified, because when I was looking at a question about indexing in the grid, someone pointed to canonical_face_model_uv_visualization.png.
So to speak, face_mesh_connections.py is incorrect and your triangle list file is not correct, either. Better to use triangle indices from above obj or pbtxt files.
Mesh generation is a form of expression. The official Python example code shows that mesh generation and face mesh connections.py is the same as canonical face model uv visualization.png is different. There needs to be a unity between the two. Maybe they need to modify the sample code.
mediapipe/mediapipe/modules/face_geometry/data/canonical_face_model.fbx
mediapipe/mediapipe/modules/face_geometry/data/canonical_face_model.obj
Hi @YongHe999 , Are you still facing any issue.
There is a problem with the meshing sample image of face_geometry,
Below is a sample image from github
https://github.com/google/mediapipe/blob/master/mediapipe/modules/face_geometry/data/canonical_face_model_uv_visualization.png
However, the image generated by the program is like the following one
https://mediapipe.dev/assets/img/photos/faceMesh.jpg
There are some differences in the division of the mesh between the two pictures. According to the line data of face_mesh_connections.py, the correct one should be the one below.
The triangle mesh list is created with reference to the coordinate point connection relationship in face_mesh_connections.py https://github.com/google/mediapipe/pull/3419