GithubHelp home page GithubHelp logo

aduverger / pix2pix Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 0.0 56.89 MB

Image-to-image translation with conditional adversarial nets

Makefile 2.91% Python 75.88% Dockerfile 0.34% Jupyter Notebook 20.87%

pix2pix's Introduction

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

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.