Skip to content

This repository contains the code for implementing an image generation system using GAN (Generative Adversarial Networks) to turn face sketches into realistic photos.

Notifications You must be signed in to change notification settings

Abhinav158/Face-Generation-from-Sketch

 
 

Repository files navigation

Face Sketch to Image Generation using GAN

This repository contains the code for implementing an image generation system using GAN (Generative Adversarial Networks) to turn face sketches into realistic photos.

pred1

Contents

Install requirements

pip install -r requirements.txt
Keras-contrib installation

Or you can refer to this link https://medium.com/@kegui/how-to-install-keras-contrib-7b75334ab742

Data Augmentation

  • The dataset consists 100 pairs faces and sketches. 88 pairs were chosen for training set.
  • Each pair is augmented to 200 pairs of face and sketch using transformation, rotation and shearing.
  • Do Data Augmentation with this notebook

GAN

  • The GAN model architecture involves two sub-models: a generator model for generating new examples and a discriminator model for classifying whether generated examples are real, from the domain, or fake, generated by the generator model.

  • GAN model consists of Generator model with 50 layers and Adversary Model with 9 layers.

Training

  • Start training GAN model with this notebook
  • GAN model trained for 82 epochs
  • Generator model Loss = 2.052
  • Discriminator model Loss = 1.139

Model Prediction after

  • 1 epoch :

  • 10 epoch :

  • 25 epoch :

  • 50 epoch :

  • 82 epoch :

Performance Measurement

  • SSIM (Structural Similarity Index) is used for measuring the similarity between two images.
  • SSIM = 0.7858
  • L2 Norm = 93.452
  • Calculate SSIM and Verification Accuracy (L2-norm) using this notebook

Testing

Generate single image with this notebook

References

[1] X. Wang and X. Tang. (2009). Face Photo-Sketch Synthesis and Recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI), 31(11), 1955-1967.

[2] W. Zhang, X. Wang and X. Tang. (2011). Coupled Information-Theoretic Encoding for Face Photo-Sketch Recognition. Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR).

[3] https://github.com/Malikanhar/Face-Sketch-to-Image-Generation-using-GAN

About

This repository contains the code for implementing an image generation system using GAN (Generative Adversarial Networks) to turn face sketches into realistic photos.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 100.0%