To use 3DDFA-V3, follow these steps to set up the environment, install dependencies, and configure the renderers.
1. Clone and Environment Setup
# Clone the repo
git clone https://github.com/wang-zidu/3DDFA-V3
cd 3DDFA-V3
# Create and activate conda environment
conda create -n TDDFAV3 python=3.8
conda activate TDDFAV3
2. Install PyTorch
Depending on your OS and CUDA version, use one of the following:
Linux/General (CUDA 10.2):
pip install torch==1.12.1+cu102 torchvision==0.13.1+cu102 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu102
Conda alternative:
conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=10.2 -c pytorch
Windows 10 (Verified for version 1.10):
pip install torch==1.10.0+cu102 torchvision==0.11.0+cu102 torchaudio==0.10.0 -f https://download.pytorch.org/whl/torch_stable.html
3. Install Dependencies and Renderers
# Install project requirements
pip install -r requirements.txt
# Install nvdiffrast (Recommended renderer)
git clone https://github.com/NVlabs/nvdiffrast.git
cd nvdiffrast
pip install .
cd ..
# Install fast CPU renderer (Fallback if nvdiffrast is unavailable)
cd util/cython_renderer/
python setup.py build_ext -i
cd ../..
cd ..
# Clone the repo:
git clone https://github.com/wang-zidu/3DDFA-V3
cd 3DDFA-V3
conda create -n TDDFAV3 python=3.8
conda activate TDDFAV3
pip install torch==1.12.1+cu102 torchvision==0.13.1+cu102 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu102
pip install -r requirements.txt
git clone https://github.com/NVlabs/nvdiffrast.git
cd nvdiffrast
pip install .
cd ..
cd util/cython_renderer/
python setup.py build_ext -i
cd ../..
cd ..