DeOldify Colorization Old Photos
Hi, in this post I will test the Awari python code that use the DeOldify Python module to colorize old photos.
The Deoldify is an open source project to colorize old images and film footage.
You can found it here:
https://github.com/jantic/DeOldify
The DeOldify enables 3 models of execution:
- Artistic
- Stable
- Video
The Video is optimized for smooth, consistent and flicker-free video, Artistic achieves the highest quality results in image coloration, in terms of interesting details and vibrance, and Stable achieves the best results with landscapes and portraits.
(Reference: https://github.com/jantic/DeOldify)
This Awari code that I will test only enable to execute in Stable mode.
First of all we need to download the files that we need to init the colorization process.
To this we will use the awari wrapper "deoldify_wrapper.py". This file made all for us, making all more easy.
To download the wrapper use this command, the file will be downloaded inside the current colab folder:
!wget https://raw.githubusercontent.com/awarischool/data-science/master/image-colorizer/deoldify_wrapper.py
The next step is import the "DeOldify" object from the "deoldify_wrapper.py":
from deoldify_wrapper import DeOldify
And instantiate the object class:
deo = DeOldify()
Now it is time to colorize the photos, to do this I only need to pass a direct image link.
I use the imgur to store and get the image link.
The images are this:
Now we need to call the method to init the colorize:
deo.colorize("<img_url_path>", render_factor)
The <img_url_path>
is the image link.
The render_factor you can change to get better results. I will use a default value of 20.
deo.colorize("https://i.imgur.com/DqSKCQ8.jpg", render_factor=20)
deo.colorize("https://i.imgur.com/n2J3jyP.jpg", render_factor=20)
deo.colorize("https://i.imgur.com/A52nUQ0.jpg", render_factor=20)
deo.colorize("https://i.imgur.com/1FtyXWJ.jpg", render_factor=20)
deo.colorize("https://i.imgur.com/XqeU201.jpg", render_factor=20)
deo.colorize("https://i.imgur.com/g1U9g1C.jpg", render_factor=20)
deo.colorize("https://i.imgur.com/nAJGSJG.jpg", render_factor=20)
deo.colorize("https://i.imgur.com/V9gYzWA.jpg", render_factor=20)
deo.colorize("https://i.imgur.com/ALBJ44D.jpg", render_factor=20)
Conclusion
The algorithm works very well in almost all tests.
Some images like image 3 and image 4 you can see some color errors, the image drawn 6 has an error, but I think there is not enough information in the original image, most of it is white.
The others looks good, especially the drawn images. The color image only change a little your original color.
The DeOldify is an exceptional algorithm, easy and fast. Any people with a little programming knowing can use it.