Code for paper "SketchyGAN: Towards Diverse and Realistic Sketch to Image Synthesis"
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wchen342 1828860ec7
Change Readme
3 years ago
data_processing Create 4 years ago
inception_v4_model Add incpetion folder 5 years ago
src_single Fix broken inception score code. 5 years ago
LICENSE Create LICENSE 5 years ago Change Readme 3 years ago Add dataset 5 years ago

SketchyGAN: Towards Diverse and Realistic Sketch to Image Synthesis

Code for "SketchyGAN: Towards Diverse and Realistic Sketch to Image Synthesis".


  • Python 3, NumPy, SciPy, OpenCV 3
  • Tensorflow(>=1.7.0). Tensorflow 2.0 is not supported.
  • A recent NVIDIA GPU


  • The path to data files needs to be specified in See below for detailed information on data files.
  • You need to download "Inception-V4 model", unzip it and put the checkpoint under inception_v4_model.


Pre-built tfrecord files are available for out of the box training.

  • Files for the Sketchy Database can be found here.
  • Files for Augmented Sketchy(i.e. flickr images+edge maps), resized to 256x256 regardless of original aspect ratios, can be found here.

Note: The webite hosting the dataset is no longer available. Please use the script under data_processing folder to crawl your own images.

If you want to build tfrecord files from images, run or for the respective dataset.

If you wish to get the image files:

  • The Sketchy Database can be found here.
  • Use under data_processing to extract images from tfrecord files. You need to specify input and output paths. The extracted images will be sorted by class names.
  • The dataset I used is no longer availabe due to its large size. You can crawl your own images and run through edge_detection/ -> edge_detection/PostprocessHED.m -> ``` to create your own dataset.
  • Please contact me if you need the original (not resized) Flickr images, since they are too large to upload to any online space.


The model can be trained out of the box, by running But there are several places you can change configurations:

  • Commandline options in
  • Some global options in
  • Activation/Normalization functions in


  • The model will be saved periodically. If you wish to resume, just use commandline switch resume_from.
  • If you wish to test the model, change mode from train to test and fill in resume_from.


If you use our work for your research, please cite our paper

author = {Chen, Wengling and Hays, James},
title = {SketchyGAN: Towards Diverse and Realistic Sketch to Image Synthesis},
booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2018}


  • Inception-V4 and VGG16 code by Tensorflow Authors.
  • Tensorflow implementation of Spectral Normalization by minhnhat93
  • Improved WGAN