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 can be seen on MNIST, CelebA, and the EFIGI Galaxy dataset.
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
.
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
.
These are some results generated by taking random attribute values from the Celeba test set.
Image | Attributes |
---|---|
Male, Smiling | |
Female, Blonde | |
Female, Heavy Makeup | |
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
Female attribute while alternating the others
Same z vector being used, but interpolating along the attribute.
These are interpolating between two different z vectors but using the same y (same attributes).
This shows interpolation between four faces (four corners) using random attributes for each face, and interpolating between the attributes as well.
-
Download the cropped and aligned celebA dataset from here as well as the annotations.
-
Your folder layout must be like so:
root_celeba/
img_align_celeba/
img_align_celeba_cropped/
list_attr_celeba.txt
-
Run the crop script on the downloaded images.
img_align_celeba_cropped/
is an empty folder made by you. Then copy theops/crop_images.py
file to yourroot_celeba/
folder and runpython crop_images.py
Everything is in different folders. Ideally, I'd like to have just one.