The source code of 'Visual Attribute Transfer through Deep Image Analogy'.
MIT License
The major contributors of this repository include Jing Liao, Yuan Yao, Lu Yuan, Gang Hua and Sing Bing Kang at Microsoft Research.
Deep Image Analogy is a technique to find semantically-meaningful dense correspondences between two input images. It adapts the notion of image analogy with features extracted from a Deep Convolutional Neural Network.
Deep Image Analogy is initially described in a SIGGRAPH 2017 paper
This is an official C++ combined with CUDA implementation of Deep Image Analogy. It is worth noticing that:
Microsoft, 2017. Licensed under a MIT license.
If you find Deep Image Analogy (include deep patchmatch) helpful for your research, please consider citing:
@article{Liao:2017:VAT:3072959.3073683,
author = {Liao, Jing and Yao, Yuan and Yuan, Lu and Hua, Gang and Kang, Sing Bing},
title = {Visual Attribute Transfer Through Deep Image Analogy},
journal = {ACM Trans. Graph.},
issue_date = {July 2017},
volume = {36},
number = {4},
month = jul,
year = {2017},
issn = {0730-0301},
pages = {120:1--120:15},
articleno = {120},
numpages = {15},
url = {http://doi.acm.org/10.1145/3072959.3073683},
doi = {10.1145/3072959.3073683},
acmid = {3073683},
publisher = {ACM},
address = {New York, NY, USA},
keywords = {deep matching, image analogy, transfer},
}
One major application of our code is to transfer the style from a painting to a photo.
It can also swap the styles between two artworks.
The most challenging application is converting a sketch or a painting to a photo.
It can do color transfer between two photos, such as generating time lapse.
deep_image_analogy.vcxproj
under windows/deep_image_analogy
to make the CUDA version in it match yours .Caffe
and add deep_image_analogy
project.deep_image_analogy
.You need to download models VGG-19 model before start to run a demo. Go to windows/deep_image_analogy/models/vgg19/
folder and download:
Open main.cpp
in windows/deep_image_analogy/source/
to see how to run a demo. You need to set several parameters which have been mentioned in the paper. To be more specific, you need to set
We also provide a pre-built executable file in folder windows/deep_image_analogy/exe/
, don't hesitate to try it.
To run this deep_image_analogy.exe
, you need to write a command line as:
deep_image_analogy.exe ../models/ ../demo/content.png ../demo/style.png ../demo/output/ 0 0.5 2 0
which means
../models/
../demo/content.png
../demo/style.png
../demo/output/
0
0.5
2
0
( 0
: WLS filter disabled, 1
: WLS filter enabled, only required for the case of photo to photo)Our codes acknowledge Eigen, PatchMatch, CudaLBFGS and Caffe. We also acknowledge to the authors of our image and style examples but we do not own the copyrights of them.