This is an automatic realistic image generator from doodles using GauGan which has been deployed on streamlit. You can check it out here. This uses GauGAN to generate the images given the semantic maps or doodles here. The model is based on Conditional GAN where given a particular image and a condition the realistic image gets generated.
The model has been taken from Nvidia labs SPADE released in 2019.
- Idea
- Sample Results
- Dataset
- Setup
- Different Components
- Fine Tuning the model
- Model and Loss
- Other Examples
- References
You can easily setup this application. Here are the steps to replicate my outcome in your system.
Clone the repository. git clone https://github.com/Shreyz-max/Doodle-to-Image-Generator.git
Create a conda environment. conda create -n doodle_image python=3.10
Activate environment. conda activate doodle_image
Install requirements file. pip install -r requirements.txt
Run app.py streamlit run streamlit/app.py
app.py
has all of the streamlit code to run the frontend.
label_colors.py
contains a list of dictionaries for each label as well as it's corresponding color that I have assigned
and its corresponding id in the coco dataset.
Here are a few things that I did.
So basically, GauGAN is trained to take a black and white semantic map and convert it into a realisitc image.
So, once we have a painted image, it is converted into black and white using its labels. I have selected a few labels from COCO
dataset. You have 182 labels. So, you can choose any of the labels. Just select a few labels from your choice from COCO dataset.
Change the color based on what you like in label_colors.py
. Make sure that the ids of those labels match those of the COCO dataset.
Also make the changes in the select-box of app.py
.
In case you want to use a different model with different datasets. Download the model from here. Use latest_net_G.pth
for this.
Doodle Input | Realistic Image |
---|---|