Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/junyanz/interactive-deep-colorization
Deep learning software for colorizing black and white images with a few clicks.
https://github.com/junyanz/interactive-deep-colorization
automatic-colorization caffe colorization computer-vision deep-learning deep-learning-algorithms interactive
Last synced: about 8 hours ago
JSON representation
Deep learning software for colorizing black and white images with a few clicks.
- Host: GitHub
- URL: https://github.com/junyanz/interactive-deep-colorization
- Owner: junyanz
- License: mit
- Created: 2017-05-08T07:27:47.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-07-29T10:15:32.000Z (over 2 years ago)
- Last Synced: 2024-12-06T19:10:33.684Z (7 days ago)
- Topics: automatic-colorization, caffe, colorization, computer-vision, deep-learning, deep-learning-algorithms, interactive
- Language: Python
- Homepage: https://richzhang.github.io/ideepcolor/
- Size: 11.6 MB
- Stars: 2,698
- Watchers: 122
- Forks: 447
- Open Issues: 32
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-neural-art - Interactive Deep Colorization
README
# Interactive Deep Colorization
[Project Page](https://richzhang.github.io/InteractiveColorization) | [Paper](https://arxiv.org/abs/1705.02999) | [Demo Video](https://youtu.be/eL5ilZgM89Q) | [SIGGRAPH Talk](https://www.youtube.com/watch?v=rp5LUSbdsys)
04/10/2020 Update: [@mabdelhack](mabdelhack) provided a windows installation guide for the PyTorch model in Python 3.6. Check out the Windows [branch](https://github.com/junyanz/interactive-deep-colorization/tree/windows) for the guide.
10/3/2019 Update: Our technology is also now available in Adobe Photoshop Elements 2020. See this [blog](https://helpx.adobe.com/photoshop-elements/using/colorize-photo.html) and [video](https://www.youtube.com/watch?v=tmXg4N4YlJg) for more details.
9/3/2018 Update: 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](https://github.com/richzhang/colorization-pytorch) repository.
Real-Time User-Guided Image Colorization with Learned Deep Priors.
[Richard Zhang](https://richzhang.github.io/)\*, [Jun-Yan Zhu](https://www.cs.cmu.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/).
In ACM Transactions on Graphics (SIGGRAPH 2017).
(\*indicates equal contribution)We first describe the system (0) Prerequisities and steps for (1) Getting started. We then describe the interactive colorization demo (2) Interactive Colorization (Local Hints Network). 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 (3) Global Hints Network.
### (0) Prerequisites
- Linux or OSX
- [Caffe](http://caffe.berkeleyvision.org/installation.html) or PyTorch
- CPU or NVIDIA GPU + CUDA CuDNN.### (1) Getting Started
- Clone this repo:
```bash
git clone https://github.com/junyanz/interactive-deep-colorization ideepcolor
cd ideepcolor
```- Download the reference model
```
bash ./models/fetch_models.sh
```- Install [Caffe](http://caffe.berkeleyvision.org/installation.html) or [PyTorch]() and 3rd party Python libraries ([OpenCV](http://opencv.org/), [scikit-learn](http://scikit-learn.org/stable/install.html) and [scikit-image](https://github.com/scikit-image/scikit-image)). See the [Requirements](#Requirements) for more details.
### (2) Interactive Colorization (Local Hints Network)
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
- Run `ipython notebook` and click on [`DemoInteractiveColorization.ipynb`](./DemoInteractiveColorization.ipynb).
If you need to convert the Notebook to an older version, use `jupyter nbconvert --to notebook --nbformat 3 ./DemoInteractiveColorization.ipynb`.
#### (2b) Full Demo GUI
- Install [Qt5](https://doc.qt.io/qt-5/gettingstarted.html) and [QDarkStyle](https://github.com/ColinDuquesnoy/QDarkStyleSheet). (See [Installation](https://github.com/junyanz/interactive-deep-colorization#installation))
- Run the UI: `python ideepcolor.py --gpu [GPU_ID] --backend [CAFFE OR PYTORCH]`. Arguments are described below:
```
--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
```- User interactions
- Adding points: Left-click somewhere on the input pad
- Moving points: Left-click and hold on a point on the input pad, drag to desired location, and let go
- Changing colors: For currently selected point, choose a recommended color (middle-left) or choose a color on the ab color gamut (top-left)
- Removing points: Right-click on a point on the input pad
- Changing patch size: Mouse wheel changes the patch size from 1x1 to 9x9
- Load image: Click the load image button and choose desired image
- Restart: Click on the restart button. All points on the pad will be removed.
- Save result: 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.
- Quit: Click on the quit button.### (3) Global Hints Network
We include an example usage of our Global Hints Network, applied to global histogram transfer. We show its usage in an iPython notebook.
- Add `./caffe_files` to your `PYTHONPATH`
- Run `ipython notebook`. Click on [`./DemoGlobalHistogramTransfer.ipynb`](./DemoGlobalHistogramTransfer.ipynb)
### Installation
- Install Caffe or PyTorch. The Caffe model is official. PyTorch is a reimplementation.- Install Caffe: see the Caffe [installation](http://caffe.berkeleyvision.org/installation.html) and Ubuntu installation [document](http://caffe.berkeleyvision.org/install_apt.html). Please compile the Caffe with the python layer [support](https://chrischoy.github.io/research/caffe-python-layer/) (set `WITH_PYTHON_LAYER=1` in the `Makefile.config`) and build Caffe python library by `make pycaffe`.
You also need to add `pycaffe` to your `PYTHONPATH`. Use `vi ~/.bashrc` to edit the environment variables.
```bash
PYTHONPATH=/path/to/caffe/python:$PYTHONPATH
LD_LIBRARY_PATH=/path/to/caffe/build/lib:$LD_LIBRARY_PATH
```- Install PyTorch: see the PyTorch [installation](https://pytorch.org/) guide.
- Install scikit-image, scikit-learn, opencv, Qt5, and QDarkStyle pacakges:
```bash
# ./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):
```bash
# ./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](https://github.com/junyanz/interactive-deep-colorization/tree/master/docker).
- **Docker**: [[OSX Docker file](https://hub.docker.com/r/vbisbest/ideepcolor_osx/)] and [[OSX Installation video](https://www.youtube.com/watch?v=IORcb4lQlxQ)] by @vbisbest, [[Docker file 2](https://hub.docker.com/r/swallner/ideepcolor/)] (by @sabrinawallner) based on [DL Docker](https://github.com/floydhub/dl-docker).
- More installation [help](https://github.com/junyanz/interactive-deep-colorization/issues/10) (by @SleepProgger).
### Training
Please find a PyTorch reimplementation of the Local Hints Network training code in the [colorization-pytorch](https://github.com/richzhang/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]](https://github.com/junyanz/CatPapers) [[Webpage]](https://www.cs.cmu.edu/~junyanz/cat/cat_papers.html)