The project involves converting a sketch image to a real life face like image using a series of GANs (Generative Adversarial Network) models. Contextual GANs, GFPGANs and DeOldify were used to implement our model which was hosted over Anvil server.
Train the model for Contextual GANs and save them. For the code of training the model, you can refer to this link Sketch to Face Code. The code doesn't support Python 3.10 so I have made changes and uploaded the updated Python files in the current repository for referral.
Once the model is trained, save it in an H5 file as per the code. The training takes months over a CPU so it's suggested to use GPUs or TPUs to train. Save the H5 file over your google drive which you can refer to your colab notebook.
Fire up the colab notebook. Run all imports and installations including accessing h5 model from google drive.
Alterations in the notebook. gfpgan_inference.py file present in the GFPGANs folder after github pull command needs to be edited. The replacement of the specific code is provided towards the end in the colab notebook.
Open Anvil. Link to colab notebook . Tutorial link which helped me - Sample Anvil article. You can also refer to the official documentations .
## Layers of Processing:
We used two metrics in our method of multigan.
Structural Similarity Index Measure and L2-Normalization score