This project is a PyTorch implementation of Image-to-Image Translation with Conditional Adversarial Networks by Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A. Efros.
This is a course project (APS360) from University of Toronto. Our main purpose is to generate city skyline images from input sketch. If interested, you can take a look at our project report for more details.
We collected images from Flickr, an image hosting service. In case you want to view our dataset, the download link is Google Drive. This 'data_uncleaned.zip' should contain our uncleaed images downloaded directly from Flickr. We also provide our cleaned dataset here Google Drive. 'input_edges' contains input sketches generated from gPb and 'real' has the corresponding real skyline images.
You can collect your own skyline images and obtain building boundaries by using gPb. Then you are able to train your own model with train.py. Feel free to change the model architecture in model.py, and change any hyperparameters we set in train.py.
Our team also provides our pre-trained model so that people can generate images directly without training. Our model isn't the best, but it should give you some fine results.
The following is the instruction on how to generate a skyline image from a sample test.jpg.
We use Anaconda with python version 3.6.7. Pytorch is the main framework we are using. Please install pytorch before running the demo code
- Download our pre-trained model from Google Drive, and put this model file under the "demo" directory.
- Go to the "demo" directory and run demo.py.
cd demo
python demo.py
- The output message should be
Done generating images, please check 'output' and 'comparison' directory.
- All Done! A generated image is stored under the 'output' directory. This is the output from the previous test.jpg.
Our model is inspired by pix2pix. The pytorch version of the code is pytorch-CycleGAN-and-pix2pix. Also I need to say thanks to my teammates, Tom and Jeremy. It has been a great pleasure working with you!