|
| 1 | + |
| 2 | +# Interactive Deep Colorization |
| 3 | + |
| 4 | +### [[Project Page]](https://richzhang.github.io/ideepcolor/) [[Paper]]() [[Demo Video]](https://youtu.be/eL5ilZgM89Q) [[Talk]](https://www.youtube.com/watch?v=FTzcFsz2xqw&feature=youtu.be&t=992) |
| 5 | +<img src='imgs/demo.gif' width=600> |
| 6 | + |
| 7 | +<!-- This repository contains a Python implementation for user-guided image colorization technique described in the following paper: --> |
| 8 | +[Richard Zhang](https://richzhang.github.io/)\*, [Jun-Yan Zhu](https://people.eecs.berkeley.edu/~junyanz/)\*, [Phillip Isola](http://people.eecs.berkeley.edu/~isola/), [Xinyang Geng](http://young-geng.xyz/), Angela S. Lin, Tianhe Yu, and [Alexei A. Efros](https://people.eecs.berkeley.edu/~efros/). |
| 9 | +**Real-Time User-Guided Image Colorization with Learned Deep Priors.** |
| 10 | +In ACM Transactions on Graphics (SIGGRAPH 2017). |
| 11 | +(\*indicates equal contribution) |
| 12 | + |
| 13 | +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>. |
| 14 | + |
| 15 | +<!-- <img src='https://richzhang.github.io/ideepcolor/index_files/imagenet_showcase_small.jpg' width=800> --> |
| 16 | + |
| 17 | +### (0) Prerequisites |
| 18 | +- Linux or OSX |
| 19 | +- [Caffe](http://caffe.berkeleyvision.org/installation.html) |
| 20 | +- CPU or NVIDIA GPU + CUDA CuDNN. |
| 21 | + |
| 22 | +### (1) Getting Started |
| 23 | +- Clone this repo: |
| 24 | +```bash |
| 25 | +git clone https://github.com/junyanz/interactive-deep-colorization ideepcolor |
| 26 | +cd ideepcolor |
| 27 | +``` |
| 28 | + |
| 29 | +- Download the reference model |
| 30 | +``` |
| 31 | +bash ./models/fetch_reference_model.sh |
| 32 | +``` |
| 33 | + |
| 34 | +- Install [Caffe](http://caffe.berkeleyvision.org/installation.html) and Python libraries ([OpenCV](http://opencv.org/)) |
| 35 | + |
| 36 | +### (2) Interactive Colorization (Local Hints Network) |
| 37 | +<img src='imgs/teaser_v3.jpg' width=800> |
| 38 | + |
| 39 | +We provide a "barebones" demo in iPython notebook, which does not require QT. We also provide our full GUI demo. |
| 40 | + |
| 41 | +#### 2(a) Barebones Interactive Colorization Demo |
| 42 | + |
| 43 | +- Run `ipython notebook` and click on [`DemoInteractiveColorization.ipynb`](./DemoInteractiveColorization.ipynb). |
| 44 | + |
| 45 | +#### 2(b) Full Demo GUI |
| 46 | + |
| 47 | +- Install [Qt4](https://wiki.python.org/moin/PyQt4) and [QDarkStyle](https://github.com/ColinDuquesnoy/QDarkStyleSheet). (See [Requirements](## (A) Requirements)) |
| 48 | + |
| 49 | +- Run the UI: `bash python ideepcolor.py --gpu [GPU_ID]`. Arguments are described below: |
| 50 | +``` |
| 51 | +--win_size [512] GUI window size |
| 52 | +--gpu [0] GPU number |
| 53 | +--image_file ['./tesT_imgs/mortar_pester.jpg'] path to the image file |
| 54 | +``` |
| 55 | + |
| 56 | +- User interactions |
| 57 | + |
| 58 | +<img src='./imgs/pad.jpg' width=800> |
| 59 | + |
| 60 | +- <b>Adding points</b>: Left-click somewhere on the input pad |
| 61 | +- <b>Moving points</b>: Left-click and hold on a point on the input pad, drag to desired location, and let go |
| 62 | +- <b>Changing colors</b>: For currently selected point, choose a recommended color (middle-left) or choose a color on the ab color gamut (top-left) |
| 63 | +- <b>Removing points</b>: Right-click on a point on the input pad |
| 64 | +- <b>Changing patch size</b>: Mouse wheel changes the patch size from 1x1 to 9x9 |
| 65 | +- <b>Load image</b>: Click the load image button and choose desired image |
| 66 | +- <b>Restart</b>: Click on the restart button. All points on the pad will be removed. |
| 67 | +- <b>Save result</b>: Click on the save button. This will save the resulting colorization in a directory where the ```image_file``` was, along with the user input ab values. |
| 68 | +- <b>Quit</b>: Click on the quit button. |
| 69 | + |
| 70 | +### (3) Global Hints Network |
| 71 | +<img src='https://richzhang.github.io/ideepcolor/index_files/lab_all_figures45k_small.jpg' width=800> |
| 72 | + |
| 73 | +We include an example usage of our Global Hints Network, applied to global histogram transfer. We show its usage in an iPython notebook. |
| 74 | + |
| 75 | +- Add `./caffe_files` to your `PYTHONPATH` |
| 76 | + |
| 77 | +- Run `ipython notebook`. Click on [`./DemoGlobalHistogramTransfer.ipynb`](./DemoGlobalHistogramTransfer.ipynb)` |
| 78 | + |
| 79 | +## (A) Requirements |
| 80 | +- Caffe (See Caffe installation [document](http://caffe.berkeleyvision.org/installation.html)) |
| 81 | +- OpenCV |
| 82 | +``` |
| 83 | +sudo apt-get install python-opencv |
| 84 | +``` |
| 85 | +- Qt4 |
| 86 | +``` |
| 87 | +sudo apt-get install python-qt4 |
| 88 | +``` |
| 89 | +- QDarkStyle |
| 90 | +``` |
| 91 | +sudo pip install qdarkstyle |
| 92 | +``` |
0 commit comments