Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
gallery
minFunc @ b721e74
MakeStylePrototxt.m
NeuralArtCost.m
NeuralArtDemo.m
NeuralArtFunc.m
NeuralArtLbfgs.m
README.md
VGG_16_nueralart.prototxt
VGG_16_nueralart_content.prototxt
VGG_16_nueralart_style.prototxt
VGG_16_nueralart_style_gen.prototxt
gaussian_net.prototxt
gaussian_net_template.prototxt
getColorPrior.m
googlenet_neuralart.prototxt
smoothL1.m

README.md

A Caffe Implementation of Neural Art

Based on paper

A Neural Algorthm of Artistic Style' by Leon Gatys, Alexander Ecker, and Matthias Bethge (http://arxiv.org/abs/1508.06576).

The model used here is VGG-16. I have thinned the net model with only conv layer paramters retaining. The thinned model can be downloaded from http://pan.baidu.com/s/1kT8d3Iv .

Usage

Open NeuralArtDemo.m by Matlab, modify the path to style image and content image, then run it.

I exploited this on my laptop and it's too slow to tune the parameters to be the best. The performance is not very good right now. However, you can still try it.

For caffe linux users: I have written a new layer called gram layer to calculate the gram matrix of a feature map. If you want to run this code with your own caffe, please add this layer to your caffe project.

I have replaced the Euclidean loss with smoothL1 loss to get better numerical stability and faster convergence speed. You can change it back to Euclidean loss in MakeStylePrototxt.m line 31. With smoothL1 loss, we need only 200 iterations to get a good result, while for Euclidean loss, we need 500 .

Gallery

style: starry night
content: tubingen

star-tubingen

I haven't add total-variance norm prior on this image because it is difficult for my laptop to tune the parameter of it, so this image may be not very smoothy.