Member-only story

Generating Human Face using GAN | TensorFlow

Shiva Verma
4 min readFeb 17, 2019

--

Image by darksouls1

In this project, I am going to show how to generate human faces using Generative Adversarial Network (GAN), which probably do not exist in real life.

Deep Convolution GAN (DC-GAN)

I will be using the Deep Convolution Generative Adversarial Network (DC-GAN) for this task. I am using CelebA dataset for training the network. This dataset contains 2,00,000 images of well-known people. I assume that you have a theoretical understanding of GANs. I will be using TensorFlow framework in this tutorial. Let’s begin.

This is how our pipeline will look like

  1. Normalize the images.
  2. Create Generator and Discriminator network.
  3. Train the network and generate new faces.

Following are the few images from our dataset.

CelebA dataset

Normalizing the images

  • As a first step, we import libraries that we will make use of.
  • We load all the images using PIL. While loading the images we crop all images around the face and resize them to (64, 64, 3)

--

--

Shiva Verma
Shiva Verma

Written by Shiva Verma

Machine Learning Engineer | Available for consultancy | shivajbd@gmail.com

Responses (2)