Deep Convolutional Generative Adversarial Networks (DCGAN) implemented with TensorFlow-Slim
This is a TensorFlow implementation of the following paper: https://arxiv.org/pdf/1511.06434v2.pdf. Some parameters and settings may not be exactly the same from the paper. Nonetheless, the code is able to generate images.
TensorFlow 1.1.0 or higher is required.
TensorFlow and tensorflow.contrib.slim
are required, along with their
dependencies (e.g. numpy). The only other additional dependency is PIL.
This can be installed with pip:
pip install Pillow
Download the celebA
dataset and put the images in data/celebA/
(create the directory structure if needed).
Train on celebA:
python main.py --experiment_name celebA_demo --dataset celebA --train True
Check out the samples
directory to see samples during training.
Sample and visualize images on trained model:
python main.py --experiment_name celebA_demo --dataset celebA
Samples and visualizations are saved to the samples
directory.
Put your images in data/your_dataset/
. Create the directory structure and
name your_dataset
with whatever you want. Images should be *.jpg
.
Train on your dataset:
python main.py --experiment_name your_dataset_demo --dataset your_dataset --train True
- The
--dataset
flag accepts whatever dataset folder you want to use in thedata/
directory. - Check out the
samples
directory to see samples during training.
Sample and visualize images on trained model:
python main.py --experiment_name your_dataset_demo --dataset your_dataset
Samples and visualizations are saved to the samples
directory.
Use TensorBoard to visualize losses and generated images.
Implement your own generator and discriminator by looking at
generator.py
and discriminator.py
. This enables extending
to different image resolutions and different tasks, for instance.