This repository contains the code for implementing an image generation system using GAN (Generative Adversarial Networks) to turn face sketches into realistic photos.
pip install -r requirements.txt
- Run the below command to copy the source code locally (Assuming git is installed) https://www.github.com/keras-team/keras-contrib.git
- cd keras-contrib
- python setup.py install
Or you can refer to this link https://medium.com/@kegui/how-to-install-keras-contrib-7b75334ab742
- 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
-
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.
- Start training GAN model with this notebook
- GAN model trained for 82 epochs
- Generator model Loss = 2.052
- Discriminator model Loss = 1.139
- 1 epoch :
- 10 epoch :
- 25 epoch :
- 50 epoch :
- 82 epoch :
- 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
Generate single image with this notebook
[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