This project implements a deep convolutional generative confrontation network (DCGAN) on a face dataset with the aim of generating images of new and realistic human faces.
- Python, pytorch, numpy
- Generative Adversarial Networks (GANs)
- DCGANs
For this project a subset of CelebFaces Attributes Dataset (CelebA) was used. The dataset can be downloaded here. Unzip the folder and place it in the folder of the project, at location face-project/processed_celeba_small
. The folder contains 89,931 images.
The hyperparameters were chosen based on the original paper Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks. conv_dim
was set at 64 but it can be changed.
Hyperparameters | Value |
---|---|
conv_dim (D, G) | 64 |
batch_size | 128 |
z_size | 100 |
learning rate | 0.0002 |
LeaklyRelu slope | 0.2 |
The model was run on GPU. CPU is not recommended. It took about 2 hrs.
Generated faces after 20 epochs of training:
Some helpful functions were used:
problem_unittests.py
: a collection of functions to test the model.workspace_utils.py
: a collection of functions to run projects inside Udacity working environment.
Using Anaconda, in an enviroment with python 3, install the following packages:
conda install jupyter, numpy
conda install -c pytorch pytorch
conda install -c pytorch torchvision