项目地址:GitHub - fudan-generative-vision/hallo: Hallo: Hierarchical Audio-Driven Visual Synthesis for Portrait Image Animation
论文地址:
https://arxiv.org/pdf/2406.08801
1、环境准备
#拉取代码
git clone https://github.com/fudan-generative-vision/hallo.git
#创建conda环境
conda create -n hallo python=3.10
conda activate hallo
#安装pytorch
conda install pytorch==2.2.2 torchvision==0.17.2 torchaudio==2.2.2 pytorch-cuda=12.1 -c pytorch -c nvidia
安装依赖:
requirements.txt内容如下:
#安装依赖:
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install .
#安装ffmpeg
apt-get install ffmpeg
2、模型下载
模型下载地址:
https://huggingface.co/fudan-generative-ai/hallo
可以手动下载,也可以git
模型夸克资源:
链接:https://pan.quark.cn/s/f7c27ae25205
提取码:VF6K
3、音频加图片推理
python scripts/inference.py --source_image examples/reference_images/1.jpg --driving_audio examples/driving_audios/1.wav
结果保存在.cache目录中
4、说明
对嘴型的效果很不错,缺点是慢
显存12g可推理