Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
122 lines (93 sloc) 2.68 KB

Simple Colorization

This pre-built model from Yang Liu provides a very simple example of photo colorization using deep neural networks. For the demonstration a sample of provided black and white photos are colorized and displayed. You can colorize your own local photo, a photo's URL, or a folder of photos using the apply command.

See the github repository for examples of its usage:


  • To install mlhub:

    $ pip3 install mlhub
  • To install and configure the pre-built model:

    $ ml install   colorize
    $ ml configure colorize


$ ml demo colorize
Loading the required Python modules ...

Loading the model ...
Demonstrate colorization using images found in

Please close each image (Ctrl-w) to proceed through the demonstration.

Colorize image_01_bw.png

Colorize image_02_bw.png

Colorize image_03_bw.png

Colorize image_04_bw.png

Colorize image_05_bw.png

Colorize image_06_bw.png

Colorize image_07_bw.png

Colorize image_09_bw.png

Colorize image_10_bw.png

To colorize images given by a path or URL:

  $ ml apply colorize


  • To colorize an image from a local file:

    $ ml apply colorize ~/.mlhub/colorize/images/image_07_bw.png

    Then the colorized image will be saved into a file like image_07_bw_color.png.

  • To colorize images in a folder:

    $ ml apply colorize ~/.mlhub/colorize/images
  • To colorize an image from the web:

    $ ml apply colorize
    $ ml apply colorize
  • To interatively colorize without repeatedly reloading the model:

    $ ml apply colorize
    Loading the required Python modules ...
    Loading the model ...
    Path or URL of images to colorize (Quit by Ctrl-d):
    (You could try images in '~/.mlhub/colorize/images/')
You can’t perform that action at this time.