Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wxc1207 opened this issue Oct 14, 2024 · 2 comments
Open

Comments

@wxc1207
Copy link

wxc1207 commented Oct 14, 2024

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
Copy link

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

@IoannisDem
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants