creating your work of art from your photo

Words
335
Reading
2 min
10y
Listen to this post
~2 min

All you need:

Medium-power processor(ofcourse, than CPU power is greater, the faster will go processing)

4GB RAM min, prefer 8 GB or more(size of the output image will depend)

OS Linux: Ubuntu 64bit V.12.04 or 14.04(if you use Windows, install a virtual machine Oracle VM VirtualBox with Ubuntu 64bit V.12.04 or 14.04)

Follow the instructions below

I will not explain what makes each command, the majority of people is useless and only complicate the process

I Just write a sequence of commands that must be entered on the command line (Terminal)

So, let's begin! Just copy an command:

sudo apt-get install git

sudo add-apt-repository ppa:ubuntu-toolchain-r/test

sudo apt-get update

sudo apt-get install gcc-4.9 g++-4.9

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9

sudo apt-get install lua5.2

sudo apt-get install luarocks

sudo apt-get install luajit

sudo apt-get install curl

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

(It takes a lot of time, You can relax :))

sudo apt-get install libprotobuf-dev protobuf-compiler

sudo luarocks install loadcaffe

sudo luarocks install image

luarocks install nn

Now you need create folder on Home directory, in Terminal enter:

mkdir workart

(or name what you want)

Now you need open this folder, in Terminal enter:

cd workart

(or your folder name)

sudo git clone https://github.com/jcjohnson/neural-style.git

sudo sh models/download_models.sh

(It takes a lot of time, You can relax again :))

Thats all, all components installed

Copy your photo and painting style image, to the neural-style folder

Open neural-style folder in terminal:

cd path/neural-style

Enter comand:

th neural_style.lua -style_image paintingstyle.jpg -content_image YourPhoto.jpg -gpu -1

Do not expect good results immediately, if the result does not suit you, you can change options

the most important of them

-content_weight: How much to weight the content reconstruction term. Default is 5e0.

-style_weight: How much to weight the style reconstruction term. Default is 1e2.

-original_colors: If you set this to 1, then the output image will keep the colors of the content image.

Change the size of the output image: image_size 800 (default 512 )

more options: https://github.com/jcjohnson/neural-style

some photos :

creating your work of art from your photo | Ecency