This is a personal project to generate 3D portrait model from a single RGB image. The project started from NVIDIA's lp3d and made modifications based on the original lp3d.
Our model has changed the dual branch encoder to learn a common human head shape (cannonical) and add details to the base 3D model.
- Install anaconda
conda env create -f environment.yml
conda activate lp3d
- Go to project folder
wget --content-disposition 'https://api.ngc.nvidia.com/v2/models/org/nvidia/team/research/eg3d/1/files?redirect=true&path=ffhq512-128.pkl' -O ffhq512-128.pkl
bash run_train.sh
- On the first machine,
bash run_distributed0.sh
. - On the second machine,
bash run_distributed1.sh
.
python gen_sample.py --outdir=out --trunc=0.9 --shapes=False --seeds=0-5 --network=ffhq512-128.pkl
- Replace the upsampler from eg3d with GFPGan upsampler