Wav2Lip-GFPGAN用法

发布时间 2023-04-11 11:24:44作者: 耀扬

下载官网:https://github.com/ajay-sainy/Wav2Lip-GFPGAN

下载:https://www.adrianbulat.com/downloads/python-fan/s3fd-619a316812.pth

改名为:s3fd.pth
存放到 /Wav2Lip-master/face_detection/detection/sfd/s3fd.pth

下载 https://drive.google.com/uc?id=1fQtBSYEyuai9MjBOF8j7zZ4oQ9W2N64q

需要梯子,文件体积 420m,挺大的模型
存放到 /Wav2Lip-master/checkpoints/wav2lip.pth

安装ffmpeg

官网:http://ffmpeg.org/

下面两个下载哪个都行
Windows builds from gyan.dev
Windows builds by BtbN
https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-essentials.7z

下载后配置环境变量

【debug】TypeError: mel() takes 0 positional arguments but 2 positional arguments (and 3 keyword解决

报错,TypeError: mel() takes 0 positional arguments but 2 positional arguments (and 3 keyword-only arguments) were given。
经查是librosa版本问题。原版本0.9.0,改成0.7.1后,问题解决。

pip uninstall librosa
pip install librosa==0.7.1 -i https://pypi.tuna.tsinghua.edu.cn/simple

No module named 'numba.decorators'

找到你安装的librosa的库中的decorators.py文件
一般在这里.\Lib\site-packages\librosa\util\decorators.py。

然后注释对应部分
注释前:

注释后:

运行

python inference.py --checkpoint_path checkpoints/wav2lip.pth --face E:\Lip-syncing\Wav2Lip-GFPGAN-main\inputs\kim_7s_raw.mp4 --audio E:\Lip-syncing\Wav2Lip-GFPGAN-main\inputs\kim_audio.mp3 --outfile E:\Lip-syncing\Wav2Lip-GFPGAN-main\outputs\abc.mp4