How to create your work of art from your photo, using your PC

in #art8 years ago (edited)

Earlier I wrote idea how to monetize your GPU on the example deepart.io

Now I want to tell you how to create your work of art, using your PC processor and neural networks

All you need:

  1. Medium-power processor(ofcourse, than CPU power is greater, the faster will go processing)
  2. 4GB RAM min, prefer 8 GB or more(size of the output image will depend)
  3. 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)
  4. 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:

  1. sudo apt-get install git
  2. sudo add-apt-repository ppa:ubuntu-toolchain-r/test
  3. sudo apt-get update
  4. sudo apt-get install gcc-4.9 g++-4.9
  5. sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
  6. sudo apt-get install lua5.2
  7. sudo apt-get install luarocks
  8. sudo apt-get install luajit
  9. sudo apt-get install curl
  10. curl s https://raw.githubusercontent.com/torch/ezinstall/master/install-all | bash
    (It takes a lot of time, You can relax :))
  11. sudo apt-get install libprotobuf-dev protobuf-compiler
  12. sudo luarocks install loadcaffe
  13. sudo luarocks install image
  14. luarocks install nn
    Now you need create folder on Home directory, in Terminal enter:
  15. mkdir workart
    (or name what you want)

Now you need open this folder, in Terminal enter:

  1. cd workart
    (or your folder name)
  2. sudo git clone https://github.com/jcjohnson/neural-style.git
  3. 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 image :)

Some result:)

Have a nice day!

Sort:  

talk about the artwork. what do you think about bitcoin and art ???
bitcoin and art

Will try, thanks for sharing

This is very nice! unfortunately I'm not good with code

okay i will try it, thanks for information

wow thats amazingly you write ...

Wooow I love the edit indeed it’s nice

nice👍👍

[WhereIn Android] (http://www.wherein.io)

waw,thats amazing....
thanks for all contribution,and keep spirit 👍

[WhereIn Android] (http://www.wherein.io)