Skip to content
master
Switch branches/tags
Code
This branch is even with master.
Contribute

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
web
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Set-conditioned DC-GAN

This is an adaptation of the standard class-conditioned DC-GAN so now generator (and discriminator) are conditioned on an additional example set (as opposed to an explicit class label) whose distribution it must match.

For a similar idea, but in an autoencoder set-up, see this paper.

Acknowledgements

This repository is based off the popular DCGAN-tensorflow repo. Many thanks to Taehoon Kim / @carpedm20.

It also uses a GAN regulariser given here. Many thanks to the authors.

Prerequisites

Usage

Test on synthetic dataset:

$ python main.py --dataset shapes --train

Or download dataset with:

$ python download.py celebA

Train a model with downloaded dataset:

$ python main.py --dataset celebA --use_tags --input_height=108 --train True

You can use your own dataset by:

$ mkdir data/DATASET_NAME
$ mkdir data/DATASET_NAME/CLASS_1
... add images to data/DATASET_NAME/CLASS_1 ...
... add images to data/DATASET_NAME/CLASS_2 ...
                   ...
... add images to data/DATASET_NAME/CLASS_N ...
$ python main.py --dataset DATASET_NAME --train
$ python main.py --dataset DATASET_NAME
$ # example
$ python main.py --dataset=eyes --input_fname_pattern="*_cropped.png" --train

Alternatively, for each image you can create a [full_filename].tags stored in the same directory as the image, consisting of a list of tags separated by spaces.

$ python main.py --dataset=eyes --use_tags

Results

celebA

CelebA dataset using tags as classes

Tag Input example set Generated samples
5_o_clock_shadow examples samples
bald examples samples
wearing_lipstick examples samples

Anime faces

Dataset based on extracted faces from danbooru images using the 500 most popular character tags, roughly 400 images per character

Tag Input example set Generated samples
artoria_pendragon_(all) examples samples
louise_francoise_le_blanc_de_la_valliere examples samples
urakaze_(kantai_collection) examples samples

About

Adaptation of conventional GAN to condition on additional input set.

Resources

License

Releases

No releases published

Packages

No packages published