CentOS上安装GeneFace++教程
sudo yum update -y
conda create -n geneface python=3.9conda activate geneface
GeneFace++的编译和运行需要C++编译工具、Python开发库及图像处理库,执行以下命令安装:sudo yum groupinstall -y "Development Tools"(安装gcc、make等基础编译工具)sudo yum install -y cmake git wget(安装CMake构建工具及Git版本控制工具)sudo yum install -y python3 python3-devel libpng-devel libjpeg-devel libtiff-devel(安装Python 3开发库及常用图像格式支持库)
从GeneFace++官方GitHub仓库克隆源代码(请替换为实际仓库地址,如https://github.com/yerfor/GeneFacePlusPlus.git):git clone https://github.com/your-repo/GeneFacePlusPlus.gitcd GeneFacePlusPlus(进入项目目录)
mkdir build && cd build
cmake ..
-j$(nproc)使用所有CPU核心加速编译,缩短等待时间):make -j$(nproc)
sudo make install
若安装路径不在系统默认路径(如/usr/local/bin)中,需手动添加环境变量,方便全局调用:
~/.bashrc或~/.bash_profile):nano ~/.bashrc
/path/to/GeneFacePlusPlus为实际安装路径):export PATH=$PATH:/path/to/GeneFacePlusPlus/bin(添加可执行文件路径)export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/GeneFacePlusPlus/lib(添加库文件路径)
source ~/.bashrc
geneface++ --help
若显示帮助信息(如支持的命令、参数说明),则说明安装完成。
参考项目文档中的示例命令(需替换音频文件路径为实际路径):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
若需要让GeneFace++随系统启动或在后台持续运行,可创建systemd服务文件:
sudo nano /etc/systemd/system/geneface++.service
[Unit]
Description=GeneFace++ Service
After=network.target
[Service]
ExecStart=/path/to/GeneFacePlusPlus/build/bin/geneface++
Restart=always
User=your_user
Group=your_group
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload(重新加载systemd配置)sudo systemctl start geneface++(启动服务)sudo systemctl enable geneface++(设置开机自启)
sudo journalctl -u geneface++ -f
yum install -y 缺失的库名)。