嘴型融合 wav2lip 升级版

环境

  • windows 10 64bit

  • wav2lip-hq

  • pytorch 1.12.1+cu113

前言

前面的博文 嘴型同步模型Wav2Lip,介绍了嘴型同步模型,本篇介绍的是 wav2lip 的高清版,在原有基础上,使用了超分辨率图像和人脸分割技术,来提升整体效果。

dabada2c238206baf594770063f9ae09.png

实践

首先,拉取源码

git clone https://github.com/Markfryazino/wav2lip-hq.git
cd wav2lip-hq

# 创建个新的虚拟环境
conda create -n wav2liphq python=3.8
conda activate wav2liphq

# 安装torch
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113

# 安装其它依赖库,将其中的torch、torchvision注释掉,前面已经安装了gpu版本
pip install -r requirements.txt

然后去下载模型,这里需要3个模型,第一个下载地址:https://drive.google.com/file/d/1aB-jqBikcZPJnFrJXWUEpvF2RFCuerSe/view?usp=sharing ,下载后拷贝到目录 checkpoints 下面;第二个模型是人脸的模型,下载地址:https://www.adrianbulat.com/downloads/python-fan/s3fd-619a316812.pth,下载后拷贝到 face_detection/detection/sfd 目录下,并重命名为 s3fd.pth;第三个是脸部的 segmentation 模型,下载地址:https://drive.google.com/open?id=154JgKpzCPW82qINcVieuPH3fZ2e0P812,拷贝到 checkpoints 目录下,并重命名为 face_segmentation.pth

最后,我们准备一个音频文件和一个视频文件来进行测试,执行命令

python.exe inference.py --checkpoint_path checkpoints\wav2lip_gan.pth --segmentation_path checkpoints\face_segmentation.pth --sr_path checkpoints\esrgan_yunying.pth --face test.mp4 --audio test.mp3 --outfile output.mp4

参考资料

  • https://github.com/Markfryazino/wav2lip-hq

  • https://github.com/zllrunning/face-parsing.PyTorch.git

  • https://github.com/xinntao/BasicSR.git

  • https://github.com/1adrianb/face-alignment

  • https://xugaoxiang.com/2021/03/05/wav2lip/

评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

迷途小书童的Note

请博主喝矿泉书!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值