Git Product home page Git Product logo

skyline-image-generation's Introduction

Skyline Image Generation

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.

Model Architecture

Generator

Alt text

Discriminator

Alt text

Goal & Motivation

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.

Sample Result

Alt text

Data

Source

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.

Usage

Train on your own

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.

Use Pre-trained Model

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.

Demo

The following is the instruction on how to generate a skyline image from a sample test.jpg.

Setting Up Environment

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

Step-By-Step instructions

  1. Download our pre-trained model from Google Drive, and put this model file under the "demo" directory.
  2. Go to the "demo" directory and run demo.py.
cd demo
python demo.py
  1. The output message should be
Done generating images, please check 'output' and 'comparison' directory.
  1. All Done! A generated image is stored under the 'output' directory. This is the output from the previous test.jpg.

Acknowledgments

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!

skyline-image-generation's People

Contributors

rwang97 avatar jeremyxu1998 avatar luoshuya avatar

Stargazers

yanggang avatar  avatar  avatar  avatar  avatar Sagar Patel avatar

Watchers

paper2code - bot avatar

Forkers

jeremyxu1998

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.