Skip to content

Image-to-image translation with conditional adversarial nets

Notifications You must be signed in to change notification settings

aduverger/pix2pix

Repository files navigation

ele.gan.t facades

Try our notebook:   Open In Colab

Image-to-image translation using conditional generative adversarial networks (cGAN).

The objective was to reproduce the original research paper from Isola et al. to generate realistic building facades from sketches.

Generated image from the cGan model

A website is available to try the fitted model, by uploading sketches or draw ones yourself : yeswegan.herokuapp.com

Setup

Install the package

The easiest way to use this library is through the Colab Notebook provided on top of this page. However, if you prefer to run this library outside a notebook, please follow the steps below.

Clone the project and install it:

git clone [email protected]:aduverger/pix2pix.git
cd pix2pix
pip install -r requirements.txt
make clean install test         # install and test

Download the data

You can download the facades dataset from Berkeley website:

cd datasets
curl -O  http://efrosgans.eecs.berkeley.edu/pix2pix/datasets/facades.tar.gz
tar -xzf facades.tar.gz && rm facades.tar.gz
cd ..

Train a model

pix2pix-train --model_name MY_MODEL

Alternatively, you have access to some hyperparameters to train a model. Please refer to the documentation of the .fit() method for details about these parameters.

pix2pix-train --model_name MY_MODEL --init 0 --epochs 200 --epochs_gen 5 --epochs_disc 0 --k 1 --l1_lambda 100

Generate a facade

pix2pix-predict --model_name MY_MODEL

Alternatively, you can choose the sketch image you want your model to generate a facade from.

You can choose a sketch by specifying an index from the test sample:

pix2pix-predict --model_name MY_MODEL --test_index 89

Or you can use a sketch of your own by specifying its file path:

pix2pix-predict --model_name MY_MODEL --file_path /~/Downloads/some_sketch.jpg

About

Image-to-image translation with conditional adversarial nets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •