Sketch to FACE Recognition using GANs (Generative Adversarial Network)

Adityalalwani
2 min readApr 29, 2021

INTRODUCTION:

Face sketch-photo transformation has broad applications in forensics, law enforcement, and digital entertainment, particular for face recognition systems that are designed for photo-to-photo matching. While there are a number of methods for face photo-to-sketch transformation, studies on sketch-to-photo transformation remain limited. The generated face photos are used, as a replacement of face sketches, and particularly for face identification against a gallery set of photos. Experimental results show that the proposed approach is able to generate realistic photos from sketches, and the generated photos are instrumental in improving the sketch identification accuracy against a large Dataset.

GANs (generative adversarial network):

Generative Adversarial Networks (GANs) are a powerful class of neural networks that are used for unsupervised learning. It was developed and introduced by Ian J. Goodfellow in 2014. GANs are basically made up of a system of two competing neural network models which compete with each other and are able to analyze, capture and copy the variations within a dataset.

source: Deep Convolutional Generative Adversarial Networks(DCGANs) | by Manish Nayak | DataDrivenInvestor

IMPLEMENTATION:

Here is the full code to build the Sketch to FACE Recognition model and the Dataset that has been used from Kaggle (Pretty Face).

.ipynb file: notebook02d1e8dce6 | Kaggle

Dataset: Pretty Face | Kaggle

DEPLOYMENT:

My whole project is available on AdityaLalwani/sketch-to-face-gans (github.com).

Create virtual environment

A virtual environment is a tool that helps to keep dependencies required by different projects separate by creating isolated python virtual environments for them. This is one of the most important tools that most of the Python developers use.

python -m venv ./venv
venv\Scripts\activate

Clone the project in specific environment (venv)

$ git clone https://github.com/mtobeiyf/keras-flask-deploy-webapp.git

Install Required Packages

pip install -r requirements.txt

Run routes.py file

py routes.py

Go to http://localhost:5000

Example.

With some extra HTML code and possibly some JavaScript, you can have a pretty and interactive website that runs on your computer. From here, you can deploy the website to a platform of your choice, be it Heroku, Amazon Web Services, or Google Cloud.

Done! 🎉

--

--