Giter Site home page Giter Site logo

cwgans's Introduction

Conditional Wasserstein GANs

This is an implementation of conditional GANs using the Improved Wasserstein (WGAN-GP) method. Currently I'm trying it out on multiple datasets, though Celeba has been the main target.

Results

Results can be seen on MNIST, CelebA, and the EFIGI Galaxy dataset.

MNIST

Below show two examples of the ability to capture style on the MNIST dataset. Each row uses the same z vector, and each column contains a different y vector representing the label. These can be reproduced via generate_mnist.py.

m1 m2

For these two images, I generated the four corners of each grid, and interpolated between both z and y. Although the model was not trained on continuous attributes (binary only), it still is able to accurately capture the latent space when given them. These can be reproduced via grid.py.

m3 m4

CelebA

These are some results generated by taking random attribute values from the Celeba test set.

Image Attributes
g1 Male, Smiling
g2 Female, Blonde
g3 Female, Heavy Makeup
g4 Female, Heavy Makeup, Smiling

Attributes in consideration: bald, bangs, black hair, blond hair, eyeglasses, heavy makeup, male, pale skin, smiling

Male attribute while alternating the others m1

m2

Female attribute while alternating the others f1

f2

Interpolation results

On just y

Same z vector being used, but interpolating along the attribute.

Bald → not bald

b1

Female → male

b2

Male, glasses, smiling, → male, no glasses, not smiling

b3

Male, glasses, smiling, bangs → no glasses, not smiling, pale skin, no bangs

b4

On just z

These are interpolating between two different z vectors but using the same y (same attributes). i1

i2

i3

Grid representation

This shows interpolation between four faces (four corners) using random attributes for each face, and interpolating between the attributes as well.

i4

How to run

  1. Download the cropped and aligned celebA dataset from here as well as the annotations.

  2. Your folder layout must be like so:

root_celeba/
   img_align_celeba/
   img_align_celeba_cropped/
   list_attr_celeba.txt
  1. Run the crop script on the downloaded images. img_align_celeba_cropped/ is an empty folder made by you. Then copy the ops/crop_images.py file to your root_celeba/ folder and run

    python crop_images.py

TODO

Everything is in different folders. Ideally, I'd like to have just one.

cwgans's People

Contributors

cameronfabbri avatar

Watchers

 avatar

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.