Skip to content
Permalink
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: https://github.com/mlhubber/colorize

Usage

  • To install mlhub:

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

    $ ml install   colorize
    $ ml configure colorize

Demonstration

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

Loading the model ...
Demonstrate colorization using images found in
 /home/gjw/.mlhub/colorize/images 

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

Commands

  • 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 https://flower-wallpaper.org/wp-content/uploads/2016/10/black-and-white-flowers-wallpaper2.jpg
    $ ml apply colorize https://flower-wallpaper.org/wp-content/uploads/2016/10/black-and-white-flower-wallpaper1-310x165.jpg
  • 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/')
    > https://flower-wallpaper.org/wp-content/uploads/2016/10/black-and-white-flowers-wallpaper2.jpg
    > https://flower-wallpaper.org/wp-content/uploads/2016/10/black-and-white-flowers-wallpaper5-1.jpg
    > https://www.designsmag.com/wp-content/uploads/2017/06/Black-White-Photography-DesignsMag-011.jpg
You can’t perform that action at this time.