Weizhi-Zhong / IP_LAP

CVPR2023 talking face implementation for Identity-Preserving Talking Face Generation With Landmark and Appearance Priors
Apache License 2.0
637 stars 72 forks source link

not detect face #23

Open whitebaby opened 1 year ago

whitebaby commented 1 year ago

En: When I run CUDA_VISIBLE_DEVICES=0 python inference_single.py, if the face in the frame is particularly large, the face detection works fine. However, when the face in the frame is relatively small, it throws an error "not detect face" with the following code:

inference_single.py code line 254: with mp_face_mesh.FaceMesh(static_image_mode=False, max_num_faces=1, refine_landmarks=True, min_detection_confidence=0.5) as face_mesh:

I have even tried changing min_detection_confidence to a very small value like 0.01, but it still cannot detect the face. How can I modify it? Thank you for creating such an amazing project. I really appreciate it.

中文:当我运行了CUDA_VISIBLE_DEVICES=0 python inference_single.py之后,如果人脸在画面中特别大,人脸检测正常,当人脸在画面比例较小时候,就会报错not detect face,with mp_face_mesh.FaceMesh(static_image_mode=False, max_num_faces=1, refine_landmarks=True, min_detection_confidence=0.5) as face_mesh:我把min_detection_confidence改成特别小的数值也不行,比如0.01,还是检测不到人脸。怎么修改?感谢你们写了这么棒的项目。非常感谢

whitebaby commented 1 year ago

"not detect face" Examples from my video:

https://github.com/Weizhi-Zhong/IP_LAP/assets/8775846/e00a2d4b-46f9-49a6-9c58-560089122283

arsm commented 1 year ago

I'm not 100% sure if it's the reason for the face detector failing, but it appears that the face in your video is small. As a result, you may not be able to use the default short-range mediapipe detector which seems to be the default case in this repository. Instead, you could try using the full-range method to see if it works or not

yuanjunchai commented 12 months ago

I'm not 100% sure if it's the reason for the face detector failing, but it appears that the face in your video is small. As a result, you may not be able to use the default short-range mediapipe detector which seems to be the default case in this repository. Instead, you could try using the full-range method to see if it works or not

So how to modify from short-range to full-range detector?

yaserabdelaziz commented 11 months ago

You might try cropping the face using another face detection tool and then passing the cropped face to short-range MediaPipe's detector.