Skip to content

Use a DCGAN on the CelebA dataset to generate images of new and realistic human faces

Notifications You must be signed in to change notification settings

hannalaguilar/Face_generation_DCGANs

Repository files navigation

Face generation with DCGANs

Project overview

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.

Technologies used:

  • Python, pytorch, numpy
  • Generative Adversarial Networks (GANs)
  • DCGANs

Data

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.

Hyperparameters

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

Training

The model was run on GPU. CPU is not recommended. It took about 2 hrs.

Generated faces after 20 epochs of training:

Installation

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

About

Use a DCGAN on the CelebA dataset to generate images of new and realistic human faces

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published