Home

Awesome

Interactive Deep Colorization

Project Page | Paper | Demo Video | SIGGRAPH Talk <img src='imgs/demo.gif' width=600>

<b>04/10/2020 Update</b>: @mabdelhack provided a windows installation guide for the PyTorch model in Python 3.6. Check out the Windows branch for the guide.

<b>10/3/2019 Update</b>: Our technology is also now available in Adobe Photoshop Elements 2020. See this blog and video for more details.

<b>9/3/2018 Update</b>: The code now supports a backend PyTorch model (with PyTorch 0.5.0+). Please find the Local Hints Network training code in the colorization-pytorch repository.

Real-Time User-Guided Image Colorization with Learned Deep Priors.
Richard Zhang*, Jun-Yan Zhu*, Phillip Isola, Xinyang Geng, Angela S. Lin, Tianhe Yu, and Alexei A. Efros.
In ACM Transactions on Graphics (SIGGRAPH 2017).
(*indicates equal contribution)

We first describe the system <b>(0) Prerequisities</b> and steps for <b>(1) Getting started</b>. We then describe the interactive colorization demo <b>(2) Interactive Colorization (Local Hints Network)</b>. There are two demos: (a) a "barebones" version in iPython notebook and (b) the full GUI we used in our paper. We then provide an example of the <b>(3) Global Hints Network</b>.

<img src='https://richzhang.github.io/InteractiveColorization/index_files/imagenet_showcase_small.jpg' width=800>

(0) Prerequisites

(1) Getting Started

git clone https://github.com/junyanz/interactive-deep-colorization ideepcolor
cd ideepcolor
bash ./models/fetch_models.sh

(2) Interactive Colorization (Local Hints Network)

<img src='imgs/teaser_v3.jpg' width=800>

We provide a "barebones" demo in iPython notebook, which does not require QT. We also provide our full GUI demo.

(2a) Barebones Interactive Colorization Demo

If you need to convert the Notebook to an older version, use jupyter nbconvert --to notebook --nbformat 3 ./DemoInteractiveColorization.ipynb.

(2b) Full Demo GUI

--win_size    [512] GUI window size
--gpu         [0] GPU number
--image_file  ['./test_imgs/mortar_pestle.jpg'] path to the image file
--backend     ['caffe'] either use 'caffe' or 'pytorch'; 'caffe' is the official model from siggraph 2017, and 'pytorch' is the same weights converted
<img src='./imgs/pad.jpg' width=800>

(3) Global Hints Network

<img src='https://richzhang.github.io/InteractiveColorization/index_files/lab_all_figures45k_small.jpg' width=800>

We include an example usage of our Global Hints Network, applied to global histogram transfer. We show its usage in an iPython notebook.

Installation

# ./install/install_deps.sh
sudo pip install scikit-image
sudo pip install scikit-learn
sudo apt-get install python-opencv
sudo apt-get install qt5-default
sudo pip install qdarkstyle

For Conda users, type the following command lines (this may work for full Anaconda but not Miniconda):

# ./install/install_conda.sh
conda install -c anaconda protobuf  ## photobuf
conda install -c anaconda scikit-learn=0.19.1 ## scikit-learn
conda install -c anaconda scikit-image=0.13.0  ## scikit-image
conda install -c menpo opencv=2.4.11   ## opencv
conda install -c anaconda qt ## qt5
conda install -c auto qdarkstyle  ## qdarkstyle

For Docker users, please follow the Docker document.

Training

Please find a PyTorch reimplementation of the Local Hints Network training code in the colorization-pytorch repository.

Citation

If you use this code for your research, please cite our paper:

@article{zhang2017real,
  title={Real-Time User-Guided Image Colorization with Learned Deep Priors},
  author={Zhang, Richard and Zhu, Jun-Yan and Isola, Phillip and Geng, Xinyang and Lin, Angela S and Yu, Tianhe and Efros, Alexei A},
  journal={ACM Transactions on Graphics (TOG)},
  volume={9},
  number={4},
  year={2017},
  publisher={ACM}
}

Cat Paper Collection

One of the authors objects to the inclusion of this list, due to an allergy. Another author objects on the basis that cats are silly creatures and this is a serious, scientific paper. However, if you love cats, and love reading cool graphics, vision, and learning papers, please check out the Cat Paper Collection: [Github] [Webpage]