CentOS安装GeneFace++技巧与步骤
sudo yum update -y更新系统软件包,确保内核及依赖库为最新版本,避免兼容性问题。sudo yum install -y cmake git python3 python3-devel libpng-devel libjpeg-devel libtiff-devel
(注:若使用CUDA加速,需额外安装对应版本的CUDA Toolkit及cuDNN,建议参考NVIDIA官方文档)。
https://github.com/yerfor/GeneFacePlusPlus)获取最新仓库地址,替换安装步骤中的URL。git clone命令下载源码,例如:git clone https://github.com/yerfor/GeneFacePlusPlus.git && cd GeneFacePlusPlus。
build目录并进入,用于隔离编译过程:mkdir build && cd build。
cmake ..生成Makefile,可根据需求添加编译选项(如指定安装路径-DCMAKE_INSTALL_PREFIX=/usr/local/geneface)。make -j$(nproc)(使用所有CPU核心加速编译),完成后用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使配置生效。
conda create -n geneface python=3.9(或python3 -m venv geneface)。
conda activate geneface(或source geneface/bin/activate)进入虚拟环境。pip install -r requirements.txt,安装PyTorch、Gradio等Python依赖。inference目录,执行示例脚本(需替换音频文件路径):export PYTHONPATH=$(pwd):$PYTHONPATH # 添加项目路径到Python搜索路径
python 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且视频播放正常,则安装成功。
libpng),用sudo yum install -y libpng-devel安装对应开发包。pip install --upgrade pip升级pip工具。sudo提升权限(仅对系统目录操作需要)。sudo systemctl stop firewalld)或配置SELinux为宽松模式(setenforce 0)。