Teach a program to paint like Van Gogh

02 Feb 2017

Untitled

There are some things that completely blow your mind. Applying artist specific styles to images is one of them. Completely sci-fiction – although the Prisma filter has made this accessible.

In the last blog, I set up the core software requirements for the Udacity deeplearning course. This blog uses the setup to transfer the styles of 3 famous paintings and apply it to images.

It takes ages for an artist to come to a signature style. It takes longer for another to mimic the style and I cannot fathom if a mimic can apply the style to different images. Deep learning does it with panache. Impressive! I am a convert.

I used the project called fast-style-transfer and ran the following command on an image to produce an output.

# creating a sandbox environment for python
conda create -n style-transfer python=3.5
source activate style-transfer
conda install -c conda-forge tensorflow=0.11.0
conda install scipy pillow

# doing style transfer
python evaluate.py --checkpoint ./rain-princess.ckpt --in-path  --out-path ./output_image.jpg

Pictures to be stylised

Untitled Untitled

The original artwork:

The Wave by Kanagawa

Untitled

Scream by Edward Munch

Untitled

Rain Princess by Leonid Affremov

Untitled

The modified images

Untitled

Untitled Untitled

Untitled
Untitled

Leave a Reply