NVlabs /SPADE

Semantic Image Synthesis with SPADE

★ 7,718⑂ 969👁 269⑃ 23● 151▤ 0
PythonCreated 2019-03-14nvlabs.github.io/SPADE/
7,718
stars
+0+1+-1
969
forks
269
watchers
23
prs
151
issues
0
releases
–
discussions

README

!Python 3.6

 Semantic Image Synthesis with SPADE
!GauGAN demo

 New implementation available at imaginaire repository

We have a reimplementation of the SPADE method that is more performant. It is avaiable at Imaginaire

 Project page |   Paper | Online Interactive Demo of GauGAN | GTC 2019 demo | Youtube Demo of GauGAN

Semantic Image Synthesis with Spatially-Adaptive Normalization.
Taesung Park,  Ming-Yu Liu, Ting-Chun Wang,  and Jun-Yan Zhu.
In CVPR 2019 (Oral).

 License

Copyright (C) 2019 NVIDIA Corporation.

All rights reserved.
Licensed under the CC BY-NC-SA 4.0 (Attribution-NonCommercial-ShareAlike 4.0 International)

The code is released for academic research use only. For commercial use or business inquiries, please contact [email protected].

For press and other inquiries, please contact Hector Marinez

 Installation

Clone this repo.
bash
git clone https://github.com/NVlabs/SPADE.git
cd SPADE/


This code requires PyTorch 1.0 and python 3+. Please install dependencies by
bash
pip install -r requirements.txt


This code also requires the Synchronized-BatchNorm-PyTorch rep.

cd models/networks/
git clone https://github.com/vacancy/Synchronized-BatchNorm-PyTorch
cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm .
cd ../../


To reproduce the results reported in the paper, you would need an NVIDIA DGX1 machine with 8 V100 GPUs.

 Dataset Preparation

For COCO-Stuff, Cityscapes or ADE20K, the datasets must be downloaded beforehand. Please download them on the respective webpages. In the case of COCO-stuff, we put a few sample images in this code repo.

Preparing COCO-Stuff Dataset. The dataset can be downloaded here. In particular, you will need to download train2017.zip, val2017.zip, stuffthingmaps_trainval2017.zip, and annotations_trainval2017.zip. The images, labels, and instance maps should be arranged in the same directory structure as in datasets/coco_stuff/. In particular, we used an instance map that combines both the boundaries of "things instance map" and "stuff label map". To do this, we used a simple script datasets/coco_generate_instance_map.py. Please install pycocotools using pip install pycocotools and refer to the script to generate instance maps.

Preparing ADE20K Dataset. The dataset can be downloaded here, which is from MIT Scene Parsing BenchMark. After unzipping the datgaset, put the jpg image files ADEChallengeData2016/images/ and png label files ADEChallengeData2016/annotatoins/ in the same directory. 

There are different modes to load images by specifying --preprocess_mode along with --load_size. --crop_size. There are options such as resize_and_crop, which resizes the images into square images of side length load_size and randomly crops to crop_size. scale_shortside_and_crop scales the image to have a short side of length load_size and crops to crop_size x crop_size square. To see all modes, please use python train.py --help and take a look at data/base_dataset.py. By default at the training phase

Snapshot: 2026-11-04T14:00:00Z · Data license Apache-2.0 · JSON