Skip to content

Commit 6c7bf29

Browse files
author
junyanz
committed
siggraph code
0 parents  commit 6c7bf29

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+11666
-0
lines changed

.gitignore

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
*.caffemodel
2+
.c9
3+
.idea
4+
test_imgs
5+
#
6+
*~
7+
.fuse*
8+
*.npy
9+
*_log
10+
*.caffemodel
11+
*.pyc
12+
*.DS_Store
13+
logger.txt
14+
cache/
15+
results/
16+
checkpoints/
17+
user_test/
18+
# luarocks build files
19+
*.src.rock
20+
*.zip
21+
*.tar.gz
22+
*.t7
23+
24+
# Caffe models
25+
*.caffemodel
26+
*.solverstate
27+
28+
# Object files
29+
*.o
30+
*.os
31+
*.ko
32+
*.obj
33+
*.elf
34+
35+
# Precompiled Headers
36+
*.gch
37+
*.pch
38+
39+
# Libraries
40+
*.lib
41+
*.a
42+
*.la
43+
*.lo
44+
*.def
45+
*.exp
46+
47+
# Shared objects (inc. Windows DLLs)
48+
*.dll
49+
*.so
50+
*.so.*
51+
*.dylib
52+
53+
# Executables
54+
*.exe
55+
*.out
56+
*.app
57+
*.i*86
58+
*.x86_64
59+
*.hex
60+
61+
.ipynb_checkpoints/

DemoGlobalHistogramTransfer.ipynb

+230
Large diffs are not rendered by default.

DemoInteractiveColorization.ipynb

+309
Large diffs are not rendered by default.

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2017 Jun-Yan Zhu and Richard Zhang
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

LICENSE_igan

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Jun-Yan Zhu
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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+
```

caffe_files/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)