Skip to content

soumik12345/colorization-using-optimization

Repository files navigation

Colorization using Optimization

build-failing

Python and C++ implementations of a user-guided image/video colorization technique as proposed by the paper Colorization Using Optimization. The algorithm is based on a simple premise; neighboring pixels in space-time that have similar intensities should have similar colors. This premise is formalized using a quadratic cost function that obtains an optimization problem that can be solved efficiently using standard techniques. While using this alogorithm, an artist only needs to annotate the image with a few color scribbles or visual clues, and the indicated colors are automatically propagated in both space and time to produce a fully colorized image or sequence. The annotation can be done using any drawing tool such as JSPaint or Gimp.

Instructions

Instructions for running python version

  1. Create a virtualenv using:

    • virtualenv venv --python=python3
    • source venv/bin/activate
    • pip install -r requirements.txt
  2. Colorize images using the CLI:

    python colorize.py
    
    Options:
        --original_image TEXT    Original Image Path
        --visual_clue TEXT       Visual Clue Image Path
        --result_path TEXT       Colorized Image Path (without file extensions)
        -i, --use_itercative     Use Iterative Mode
        --epochs INTEGER         Number of epochs for Iterative Mode
        --log_intervals INTEGER  Log Interval
        --help                   Show this message and exit.
    
  3. Alternatively, you can run on Google Colab using Open In Colab

Instructions to build C++ version

  1. Install dependencies using sh install.sh

  2. Create a build directory mkdir build && cd build

  3. Generate makefiles and compile using cmake .. && make

  4. Run the executable using ./colorization [input-image] [visual-clues] [result] [gamma] [threshold]

  5. Alternatively, you can download the executable from here and run it (installation of dependencies is still needed).

Results

Original Image Visual Clues Colorized Image

About

Python and C++ implementations of a user-guided image/video colorization technique as proposed by the paper Colorization Using Optimization

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published