Note: The official name of the project is GeneFace++ (not "GeneFace" or "Easy-Wav2lip"), and its installation steps vary by Linux distribution. Below are detailed guides for CentOS (the most commonly documented distribution) and general notes for other Linux systems.
Before installing GeneFace++, ensure your system meets the following requirements:
Run the following commands to update your system and install essential development tools and libraries:
sudo yum update -y
sudo yum groupinstall -y "Development Tools" # Installs GCC, Make, etc.
sudo yum install -y cmake git wget # Installs build tools and version controlThese steps ensure your system has the necessary tools to compile and install GeneFace++.
GeneFace++ requires Python 3.9+ and several Python packages. Use conda to create an isolated environment and avoid conflicts:
# Download and install Miniconda (if not already installed)
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p $HOME/miniconda
source $HOME/miniconda/etc/profile.d/conda.sh
# Create and activate a Python 3.9 environment
conda create -n geneface python=3.9 -y
conda activate geneface
# Install Python dependencies (including FFmpeg for video processing)
conda install -y conda-forge::ffmpeg
pip install -r requirements.txt # Replace with the actual path to GeneFace++'s requirements fileThis step sets up a clean Python environment and installs critical packages like numpy, torch, and opencv-python.
Clone the GeneFace++ source code from its official GitHub repository (replace the URL with the correct one if needed):
git clone https://github.com/yerfor/GeneFacePlusPlus.git
cd GeneFacePlusPlusEnsure you have Git installed (sudo yum install -y git) before running this command.
Navigate to the project directory and compile the source code using cmake and make:
mkdir build && cd build
cmake .. # Configures the build system
make -j$(nproc) # Compiles the code using all available CPU cores (speeds up the process)
sudo make install # Installs GeneFace++ to the system (default path: /usr/local/)This step compiles the C++/CUDA components of GeneFace++ and installs them to your system.
If the installation path is non-standard (e.g., not /usr/local/), add the following lines to your shell configuration file (e.g., ~/.bashrc or ~/.zshrc):
export PATH=$PATH:/path/to/GeneFacePlusPlus/build/bin # Replace with the actual binary path
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/GeneFacePlusPlus/build/lib # Replace with the actual library pathApply the changes by running source ~/.bashrc (or source ~/.zshrc).
Run the following command to check if GeneFace++ is installed correctly:
geneface++ --helpYou should see a list of available commands and options. If this fails, revisit the previous steps to ensure all dependencies and configurations are correct.
GeneFace++ requires 3D Morphable Models (3DMMs) for face reconstruction. Download the BFM2009 model (or another supported model) and place it in the designated directory (e.g., GeneFacePlusPlus/deep_3drecon/BFM/). Follow the project’s documentation for specific file placement instructions.
Execute a sample inference script to verify that GeneFace++ works as expected. For example:
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.mp4Replace example.wav with the path to your audio file. This script generates a video (demo_output.mp4) with synthesized facial animations.
libpng, libjpeg), install them using your distribution’s package manager (e.g., sudo yum install -y libpng-devel libjpeg-devel).requirements.txt or project documentation). Reinstall CUDA if necessary.conda to create an isolated environment (as shown above) to avoid conflicts with system Python packages.gcc --version) and that all build tools are installed.For Ubuntu/Debian-based systems, replace yum with apt in the dependency installation steps (e.g., sudo apt update && sudo apt install -y cmake git wget). The compilation and installation steps remain largely the same. Always refer to the official GeneFace++ documentation or repository README for distribution-specific adjustments.