Rudrabha / Wav2Lip

This repository contains the codes of "A Lip Sync Expert Is All You Need for Speech to Lip Generation In the Wild", published at ACM Multimedia 2020. For HD commercial model, please try out Sync Labs
https://synclabs.so
10.87k stars 2.3k forks source link

AttributeError: module 'face_detection' has no attribute 'FaceAlignment' #716

Open wxc1207 opened 1 month ago

wxc1207 commented 1 month ago

I am trying to sequentially switch the versions of face-detection to (0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.2.0, 0.2.1, 0.2.2), but I still cannot find the face-detection module. Is this because of version incompatibility, or is there another issue? I hope to get help::

(wav2lip1) root@autodl-container-b52c468700-adae5615:~/autodl-fs/wav2lip# python inference.py --checkpoint_path /root/autodl-fs/wav2lip/checkpoint_path/wav2lip.pth --face /root/autodl-fs/wav2lip/wxc-data/origin.mp4 --audio /root/autodl-fs/wav2lip/wxc-data/123.wav Using cuda for inference. Reading video frames... Number of frames available for inference: 8325 (80, 2627) Length of mel chunks: 981 0%| | 0/8 [00:00<?, ?it/s] Traceback (most recent call last): File "inference.py", line 280, in main() File "inference.py", line 250, in main total=int(np.ceil(float(len(mel_chunks))/batch_size)))): File "/root/miniconda3/envs/wav2lip1/lib/python3.6/site-packages/tqdm/std.py", line 1127, in iter for obj in iterable: File "inference.py", line 113, in datagen face_det_results = face_detect(frames) # BGR2RGB for CNN face detection File "inference.py", line 69, in face_detect detector = face_detection.FaceAlignment(face_detection.LandmarksType._2D, AttributeError: module 'face_detection' has no attribute 'FaceAlignment'

hello9527-z commented 1 month ago

你需要手动下载face_detection,然后放在与inference.py同一文件夹下

IoannisDem commented 2 weeks ago

I believe you try to pip install face-detection from here: https://pypi.org/project/face-detection/

However, the face_detection model is defined within this repo which is taken from here: https://github.com/1adrianb/face-alignment (Here is the relevant folder from this repo: https://github.com/Rudrabha/Wav2Lip/tree/master/face_detection)

Basically, you try to imoprt the wrong model