Open In Colab

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:

#hide_output
!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":

#hide_output
from deoldify_wrapper import DeOldify

And instantiate the object class:

#hide_output
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:

images

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.

Black and White Photos

First I will test old black and white photos:

Image 1

deo.colorize("https://i.imgur.com/DqSKCQ8.jpg", render_factor=20)

Image 2

deo.colorize("https://i.imgur.com/n2J3jyP.jpg", render_factor=20)

Image 3

deo.colorize("https://i.imgur.com/A52nUQ0.jpg", render_factor=20)

Image 4

deo.colorize("https://i.imgur.com/1FtyXWJ.jpg", render_factor=20)

Image 5

deo.colorize("https://i.imgur.com/XqeU201.jpg", render_factor=20)

Drawn Black and White Images

Now I will test drawn images.

Image 6

deo.colorize("https://i.imgur.com/g1U9g1C.jpg", render_factor=20)

Image 7

deo.colorize("https://i.imgur.com/nAJGSJG.jpg", render_factor=20)

Image 8

deo.colorize("https://i.imgur.com/V9gYzWA.jpg", render_factor=20)

Color Images

In the last test, I will try color images to see how the algorithm works.

Image 8

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.