Unofficial Pytorch implementation of GauGAN, from Semantic Image Synthesis with Spatially-Adaptive Normalization (Park et al. 2019). Implementation for Generative Adversarial Networks (GANs) Specialization course material.
- Download the Cityscapes dataset, unzip the
gtFine_trainvaltest.zip
andleftImg8bit_trainvaltest.zip
folders and move them todata
directory. - All Python requirements can be found in
requirements.txt
. Support for Python>=3.7. - Default config for can be found in
config.yml
. All defaults are as per the configurations described in the original paper and code.
By default, all checkpoints will be stored in logs/YYYY-MM-DD_hh_mm_ss
, but this can be edited via the train.log_dir
field in the config files.
- To train GauGAN, run
python train.py
.
- Edit the
resume_checkpoint
fieldconfig.yml
to reflect the desired checkpoint from training and runpython infer.py --encode
. The--encode
flag generates Gaussian statistics from the input image via the encoder. If not specified, noise will be sampled from a standard Gaussian.
You can edit the number of test images to show with the flag
--n_show
. Defaults to 5.