JimWest / MeFaMo

MIT License
482 stars 103 forks source link

what is get_metric_landmarks function for? #4

Closed xuguozhi closed 2 years ago

xuguozhi commented 2 years ago

Hi I am reading your code. I don't know what is the purpose for get_metric_landmarks https://github.com/JimWest/MeFaMo/blob/341813f8b33c57ef9eabdcb7c20c02c70963675b/mefamo/custom/face_geometry.py#L2482

JimWest commented 2 years ago

Hi, I think this article explains it best: https://google.github.io/mediapipe/solutions/face_mesh.html#key-concepts

The default keypoints you get from mediapipe are in 2d normalized camera space and that function (which uses the mediapipe canoncial face model and the OpenCV SolvePnP function), the get_metric_landmarks() function will give you normalized 3d coordinates. You can visualize those coordinates with the --show_3d parameter (which shows those 3d coordinates in a 2d window, but you'll how stable they are compared to the default 2d ones).

xuguozhi commented 2 years ago

yes , much stable than 2D direct points