Coder Social home page Coder Social logo

a-martyn / pix2pix Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 1.0 265.97 MB

Implementation of the Pix2Pix GAN in Tensorflow/Keras

Home Page: https://www.alanmartyn.com

Python 3.27% Shell 0.05% Jupyter Notebook 63.76% HTML 32.92%
gan pix2pix pix2pix-tensorflow keras keras-tensorflow generative-adversarial-network generative-model deep-learning machine-learning paper

pix2pix's Introduction

pix2pix in Tensorflow and Keras

An implementation of the pix2pix paper using Keras to build models and Tensorflow to train.

The model is trained on the façades dataset. In this setting the model is provided with a diagram of a buildings' facade, showing the layout of windows, doors, balconies, mantels, with the objective being to generate a photo-realistic rendering.

A webpage is updated during training so that you can watch the model learn. Notice the development of concepts such as reflective windows, dampness and mildew on render, stonework detail, and shadows under balconies. Here's a few examples from the end of training.

Here the columns are:

  • Input: the diagram provided as input to the model as reference
  • Authors' Pytorch: Generated output of model provided by the authors of the original paper
  • This Implementation: Generated output of this implementation
  • Target: Real photograph of the building
  • Patchgan: A heatmap visualisation showing which parts of the generated image (in 3rd column) the discriminator classifies as real (white) and fake (grey).

See the full training results by downloading this repo and opening results/index.html in your browser. Or train the model yourself by following the steps below.

Install dependencies

Tensorflow 1.13.1 requires CUDA 10 drivers if running on GPU, installation steps here. If running on CPU, change tensorflow-gpu to tensorflow in requirements.txt.

Setup python environment:

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Train model

Download facades dataset:

bash download_dataset.sh façades

Preprocess data:

python preprocess.py

Train:

python train.py --experiment_title my_experiment

Watch the model learn

To view results as the model trains open results/index.html in your browser to view training progress visualisations, including training plots and checkpoint images for each epoch.

References

pix2pix's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ihsan149

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.