一、安装前准备
sudo yum update -y确保系统软件包为最新版本,避免兼容性问题。sudo yum install -y cmake git python3 python3-devel libpng-devel libjpeg-devel libtiff-devel。
二、获取GeneFace++源码
yerfor/GeneFacePlusPlus为例),替换为实际仓库地址:git clone https://github.com/yerfor/GeneFacePlusPlus.git。
cd GeneFacePlusPlus。三、创建并配置Python虚拟环境
conda create -n geneface python=3.9(conda)或python3 -m venv geneface(venv)。
conda activate genefacesource geneface/bin/activate。四、安装Python依赖
pip install -r requirements.txt(确保pip为最新版本,可通过pip install --upgrade pip升级)。
五、编译安装C++组件(若有)
mkdir build && cd build。cmake ..(若需自定义编译选项,可在此步骤添加参数,如-DCMAKE_INSTALL_PREFIX=/usr/local/geneface)。make(编译源码),sudo make install(安装至系统目录)。六、配置环境变量(可选但推荐)
/usr/local/geneface),需将以下内容添加到~/.bashrc或~/.bash_profile:export PATH=$PATH:/path/to/GeneFacePlusPlus/bin(可执行文件路径)export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/GeneFacePlusPlus/lib(库文件路径)。
source ~/.bashrc或source ~/.bash_profile。七、下载预处理数据与模型权重
./deep_3drecon/BFM目录。./data/binary/videos/May。audio2motion_vae、motion2video_nerf等预训练模型,放置到对应checkpoints目录(如./checkpoints/audio2motion_vae、./checkpoints/motion2video_nerf/may_head)。八、测试安装
export PYTHONPATH=$(pwd):$PYTHONPATH(将项目根目录加入Python搜索路径)。/home/user/audio/example.wav):`python inference/genefacepp_infer.py \
--a2m_ckpt=checkpoints/audio2motion_vae \
--head_ckpt=checkpoints/motion2video_nerf/may_head \
--torso_ckpt=checkpoints/motion2video_nerf/may_torso \
--drv_aud=data/raw/val_wavs/example.wav \
--out_name=demo_output.mp4`。
demo_output.mp4,则说明安装完成。注意事项
sudo systemctl stop firewalld(测试后记得开启:sudo systemctl start firewalld)。sudo setenforce 0(测试后恢复:sudo setenforce 1)。README.md或GitHub Issues页面,获取最新解决方案。