Replication of GAN2Shape. We participated with this code in the Machine Learning Reproducibility Challenge 2021 and our paper for accepted for publication at ReScience C journal, our report is also temporarily available in the OpenReview forum.
Cats (Ellipsoid) | Cats (Smoothed Box) | Cars (Ellipsoid) | Cars (Smoothed Box) | Faces (Ellipsoid) | Faces (Confidence) |
---|---|---|---|---|---|
The results are also available interactively at alessiogalatolo.github.io/GAN-2D-to-3D/.
sudo apt update
sudo apt install build-essential
# CUDA toolkit
wget https://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_440.33.01_linux.run
sudo sh cuda_10.2.89_440.33.01_linux.run
# Install Conda
curl -LO https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh
bash Miniconda3-py39_4.10.3-Linux-x86_64.sh
Close and reopen terminal
conda create --name 3D-GAN pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=10.0 -c pytorch
conda activate 3D-GAN
# Install neural renderer
git clone https://github.com/daniilidis-group/neural_renderer.git
cd neural_renderer
python setup.py install
# Install all other dependencies
conda install numpy pandas distributed ipython lmdb matplotlib Pillow scipy tqdm scikit-image
conda install PyYAML -c conda-forge
conda install wandb -c conda-forge # optional
conda install -y -c anaconda ipykernel ipython_genutils # only needed if running on notebook
pip install plotly # only needed for evaluating results
The procedure is the same except for the installing the neural renderer that will not work out of the box on windows. Please see our guide here for a procedure that might work for installing the neural renderer on Windows.
First you need to download the various datasets:
python download_data.py
python main.py --save-ckpts
To evaluate the results:
python evaluate_results.py
Part of this code is borrowed from Unsup3d, StyleGAN2, Semseg and BiSeNet.