google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
27.79k stars 5.18k forks source link

inconsistent face landmarker detection result #5599

Closed gubinfdu closed 2 months ago

gubinfdu commented 3 months ago

I tried two methods to detect face landmarkers, but got different results. Would you please check this issue?

Method 1:

face_mesh = mp.solutions.face_mesh.FaceMesh(
    max_num_faces=1,
    refine_landmarks=True,
    min_detection_confidence=0.5,
    min_tracking_confidence=0.5
)
landmarks = face_mesh.process(img).multi_face_landmarks[0].landmark

Method 2: Got face_landmarks_detector.tflite model from here: https://ai.google.dev/edge/mediapipe/solutions/vision/face_landmarker?hl=zh-cn

interpreter = tf.lite.Interpreter(model_path=path)
interpreter.allocate_tensors()
input_details = interpreter.get_input_details()
input_index = input_details[0]['index']
interpreter.set_tensor(input_index, img_resize)
interpreter.invoke()
landmarks = interpreter.get_tensor(473)

Tried to plot facial contour and found some distortion in second method. I need to use this tflite model, and would you please help to solve this problem?

kuaashish commented 3 months ago

Hi @gubinfdu,

It appears that you are currently using the legacy facemesh solution. We would like to inform you that the face mesh functionality is now part of the Face Landmarker Task API, as outlined in the documentation. This API serves as a superset of the facemesh solution and offers easier adoption across all platforms with ongoing maintenance.

However, support for the legacy face mesh solution has been completely discontinued for all upgraded solutions as well, as detailed in the same page. While the GitHub source codes and NPM packages for the legacy solution will remain available, But we will not be providing support for them.

We recommend exploring our new Face Landmarker and referring to the overview documentation available on the page. For implementation on Python, please follow the Python Setup guide provided here and Colab example you can find here

Also, We kindly request you to report any similar behavior if observed in the upgraded solution.

Thank you!!

S3od22 commented 3 months ago

سعودددًًs3.@“..

في اثنين، 2 سبتمبر، 2024 في 6:10 ص، كتب gubinfdu @.***>:

I tried two methods to detect face landmarkers, but got different results. Would you please check this issue?

Method 1:

face_mesh = mp.solutions.face_mesh.FaceMesh( max_num_faces=1, refine_landmarks=True, min_detection_confidence=0.5, min_tracking_confidence=0.5 )landmarks = face_mesh.process(img).multi_face_landmarks[0].landmark

Method 2: Got face_landmarks_detector.tflite model from here:

https://ai.google.dev/edge/mediapipe/solutions/vision/face_landmarker?hl=zh-cn

interpreter = tf.lite.Interpreter(model_path=path)interpreter.allocate_tensors()input_details = interpreter.get_input_details()input_index = input_details[0]['index']interpreter.set_tensor(input_index, img_resize)interpreter.invoke()landmarks = interpreter.get_tensor(473)

Tried to plot facial contour and found some distortion in second method. I need to use this tflite model, and would you please help to solve this problem?

— Reply to this email directly, view it on GitHub https://github.com/google-ai-edge/mediapipe/issues/5599, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARBYYXT3EUKZNS4BQVKS4V3ZUPJLDAVCNFSM6AAAAABNPOHZBGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4TSOJQGMZTIMI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

S3od22 commented 3 months ago

سعودددًًs3.@“.. ً

في اثنين، 2 سبتمبر، 2024 في 10:03 ص، كتب سعود العسيري @.***

:

سعودددًًs3.@“..

في اثنين، 2 سبتمبر، 2024 في 6:10 ص، كتب gubinfdu @.***

:

I tried two methods to detect face landmarkers, but got different results. Would you please check this issue?

Method 1:

face_mesh = mp.solutions.face_mesh.FaceMesh( max_num_faces=1, refine_landmarks=True, min_detection_confidence=0.5, min_tracking_confidence=0.5 )landmarks = face_mesh.process(img).multi_face_landmarks[0].landmark

Method 2: Got face_landmarks_detector.tflite model from here:

https://ai.google.dev/edge/mediapipe/solutions/vision/face_landmarker?hl=zh-cn

interpreter = tf.lite.Interpreter(model_path=path)interpreter.allocate_tensors()input_details = interpreter.get_input_details()input_index = input_details[0]['index']interpreter.set_tensor(input_index, img_resize)interpreter.invoke()landmarks = interpreter.get_tensor(473)

Tried to plot facial contour and found some distortion in second method. I need to use this tflite model, and would you please help to solve this problem?

— Reply to this email directly, view it on GitHub https://github.com/google-ai-edge/mediapipe/issues/5599, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARBYYXT3EUKZNS4BQVKS4V3ZUPJLDAVCNFSM6AAAAABNPOHZBGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4TSOJQGMZTIMI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

github-actions[bot] commented 2 months ago

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

github-actions[bot] commented 2 months ago

This issue was closed due to lack of activity after being marked stale for past 7 days.

google-ml-butler[bot] commented 2 months ago

Are you satisfied with the resolution of your issue? Yes No