This is official PyTorch implementation of NeurIPS 2018 paper Learning Hierarchical Semantic Image Manipulation through Structured Representations by Seunghoon Hong, Xinchen Yan, Thomas Huang, Honglak Lee.
Please follow the instructions to run the code.
conda install pytorch torchvision cudatoolkit=9.0 -c pytorch
pip install tensorflow-gpu==1.5
pip install dominate
Please run the following script that creates two folders checkpoints/
and datasets/
.
bash setup.sh
Please download the Cityscapes dataset from the official website (registration required). After downloading, please put these files under the datasets/cityscape/
folder and run the following script.
python preprocess_city.py
Please download the ADE20K dataset from the official website. After downloading, please put these files under the datasets/ade20k/
folder and run the following script.
python preprocess_ade.py
bash scripts/download_pretrained_box2mask_city.sh
bash scripts/download_pretrained_box2mask_ade.sh
checkpoints/
.
bash scripts/test_pretrained_box2mask_city.sh
bash scripts/test_pretrained_box2mask_ade.sh
bash scripts/download_pretrained_mask2image_city.sh
bash scripts/download_pretrained_mask2image_ade.sh
checkpoints/
.
bash scripts/test_pretrained_mask2image_city.sh
bash scripts/test_pretrained_mask2image_ade.sh
results/
folder.
bash scripts/test_joint_inference_city.sh
bash scripts/train_box2mask_city.sh
bash scripts/train_box2mask_ade.sh
bash scripts/train_mask2image_city.sh
bash scripts/train_mask2image_ade.sh
If you find this useful, please cite our work as follows:
@inproceedings{hong2018learning,
title={Learning hierarchical semantic image manipulation through structured representations},
author={Hong, Seunghoon and Yan, Xinchen and Huang, Thomas E and Lee, Honglak},
booktitle={Advances in Neural Information Processing Systems},
pages={2713--2723},
year={2018}
}
We would like to thank the amazing developers and the open-sourcing community. Our implementation has especially been benefited from the following excellent repositories: