Code for the CVPR 2021 paper by Yiming Qian, Hao Zhang, and Yasutaka Furukawa. Supplementary document is here.
Clone the repository:
git clone https://github.com/yi-ming-qian/roofgan.git
We use Python 3.7 and PyTorch 1.2.0 in our implementation, please install dependencies:
conda create -n roofgan python=3.7
conda activate roofgan
conda install pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=10.0 -c pytorch
conda install -c conda-forge opencv
pip install -r requirements.txt
Please download our dataset from here. Then, change the option "data_root" in both "scripts/train_gan.sh" and "scripts/test_gan.sh" to the directory containing the dataset.
Run the following command to train Roof-GAN:
sh ./scripts/train_gan.sh
Run the following command to generate roof models:
sh ./scripts/test_gan.sh
The generated models will be saved under "experiments/{proj_dir}/results/". We also provide our pre-trained models here. To use it, please place it under "experiments/{proj_dir}/model_gan/".
Run the following commands to evaluate with the RMMD and FID metrics:
cd evaluate
sh evaluate_RMMD.sh
cd fid
sh evaluate_fid.sh
Our generated results can be downloaded from here, which should be placed at "experiments/" after unzipping.
https://yi-ming-qian.github.io/
We thank the authors of PQ-Net and of House-GAN. Parts of our implementation are modified based on their codes. The FID metric implmentation is copied from mseitzer/pytorch-fid.