Weizhi-Zhong / IP_LAP

CVPR2023 talking face implementation for Identity-Preserving Talking Face Generation With Landmark and Appearance Priors

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

not detect face

whitebaby opened this issue · comments

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,还是检测不到人脸。怎么修改?感谢你们写了这么棒的项目。非常感谢

"not detect face" Examples from my video:

DM_20230601122945_003.mp4
commented

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

commented

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?

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