This project focuses on generating faces corresponding to specific facial features. We use Generative Adversarial Networks (GANs) to pursue this task. Our GAN is an extension of the DCGAN with addition of deep residual learning to learn effectively. Such a model can assist police sketch artists and even automate the sketch generation task. Here the descriptive facial features are the inputs to the GAN which generates a face corresponding to those features. We are able to control cetain facial features individually, which is demonstrated by tweaking a particular feature in the face generated.
We use the CelebFaces Attributes Dataset which has more than 200K celebrity images, each with 40 attribute annotations.
The project code was written using the PyTorch
library.
The directory code
contains files used to build and run the model. A brief description is as follows:
-
dataset.py
defines the dataloader. -
runner.py
defines the training and testing functions. -
config.py
defines the parameters. -
model.py
defines the generator and the discriminator networks. -
In order to run the model, type the following command from within the
code
directory:
python3 main.py
- Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks. Alec Radford, Luke Metz, and Soumith Chintala.
- Deep Residual Learning for Image Recognition. Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun.
- Deep Learning Face Attributes in the Wild. Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang.