Git Product home page Git Product logo

image-generation-and-translation's Introduction

Image-Generation-And-Translation

Implementation and additional results of "Image Generation and Translation with Disentangled Representations".

The work presented here was done at the Knowledge Technology Research Group at the University of Hamburg and accepted as a conference contribution to the IJCNN 2018.

To Run the Experiment on MNIST Data Set

Requirements:

  • Tensorflow 1.5.0
  • Numpy 1.14.1

Run Experiment:

  • run python code/train_mnist.py Results are stored in code/log_dir/mnist_sem_sup
  • to visualize results: tensorboard --logdir code/log_dir/mnist_sem_sup
  • for each experiment run log_dir also contains a file info.txt detailing the generator and encoder accuracy after X iterations, as well as other information about the training progress

To evaluate the results:

  • run python code/evaluate_model.py --model_dir dir-where-model-weights-are-stored with one of the following flags:

    • --generate: generates samples varying the categorical and continuous parts of the disentangled part of the representation and stores the result in "model_dir/samples"
    Generated categorical Generated continuous 1 Generated continuous 2
    • --translate: translates images from the test set according to the categorical and continuous parts of the disentangled part of the representation and stores the result in "model_dir/samples". The first column of each image depicts the original image, the following columns depict the translations according to the variables in c. The categorical translation translates an image into each of the 10 digits, while the continuous translation takes an image and sets the encoding of one continuous variable to {-1, 0, 1}
    Categorical translation Continuous translation
    • --interpolate: interpolates between images. When prompted type the start digit (digit which should be in the start image) and end digit (digit which should be in the end image). Results are stored in "model_dir/samples"
    Interpolation 2 to 7 Interpolation 4 to 9 Interpolation 5 to 8
    • --reconstruct: samples images from the test set, encodes them, and gives the encoding to the generator for reconstructions. Results are stored in "model_dir/samples"
    Reconstruction Example 1 Reconstruction Example 2

Figures from the paper

MNIST

Random samples generated by the Generator

Class translations

Interpolations

SVHN

Random samples generated by the Generator

Interpolations

Class translations

Continuous translations

CelebA

Random samples generated by the Generator

Class translations

Continuous translations

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.