Neural Style

From GoBlueMich Wiki
Jump to navigation Jump to search

Install

Ubuntu 14.04

Basic Tools

apt-get install lua5.2
apt-get install luarocks
apt-get install luajit

Frameworks

curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-all | bash
luajit -ltorch

Exit that interface

apt-get install libprotobuf-dev protobuf-compiler
luarocks install loadcaffe

Double Check Dependencies

luarocks install image
luarocks install nn

Deep Style

mkdir ~/DeepStyle
cd ~/DeepStyle
git clone https://github.com/jcjohnson/neural-style.git

This might take a bit....

cd neural-style
sh models/download_models.sh

Use Deep Style/Neural Style

Get Images

cd ~/DeepStyle/neural-style
wget image.jpg
wget image2.jpg

Start it up!

th neural_style.lua -style_image YOURPAINTINGHERE.jpg - content_image YOURPHOTOHERE.jpg -gpu -1 -output_image NEWPHOTO.jpg -print_iter 10 -save_iter 100 

(Obviously, you’ll need to replace the chunks in ALL CAPS with the names of your files).