Organize and Share your Electronics the way you want. Sign-Up for a free account now. It takes only 30 seconds!

Prisma photo? No thanks, I’d use the open source deep learning from Torch on GitHub

Prisma photo? No thanks, I’d use the open source deep learning from Torch on GitHub

Prisma filter is a real “a must do trend” in smartphone photography, nowadays. It transforms your photos into artworks using the styles of famous artists: Van Gogh, Picasso, Levitan, as well as world famous ornaments and patterns. A unique combination of neural networks and artificial intelligence helps you turn memorable moments into timeless art.

How do they make it? Pre-processed gallery? Simple photo effects? Wizardry? Nope, it is a process called “deep learning algorithm”, and it is done through the use of convolutional neural networks.

The good news is that we have open source version of that algorithm!

This is a torch implementation of the paper A Neural Algorithm of Artistic Style by Leon A. Gatys, Alexander S. Ecker, and Matthias Bethge.

The paper presents an algorithm for combining the content of one image with the style of another image using convolutional neural networks. Here’s an example that maps the artistic style of The Starry Night onto a night-time photograph of the Stanford campus:

torch prisma

Setup:

Dependencies:

Optional dependencies:

After installing dependencies, you’ll need to run the following script to download the VGG model:

<code>sh models/download_models.sh
</code>

This will download the original VGG-19 model. Leon Gatys has graciously provided the modified version of the VGG-19 model that was used in their paper; this will also be downloaded. By default the original VGG-19 model is used.

If you have a smaller memory GPU then using NIN Imagenet model will be better and gives slightly worse yet comparable results. You can get the details on the model from BVLC Caffe ModelZoo and can download the files from NIN-Imagenet Download Link

You can find detailed installation instructions for Ubuntu in the installation guide.

Usage

Basic usage:

<code>th neural_style.lua -style_image &lt;image.jpg&gt; -content_image &lt;image.jpg&gt;
</code>

OpenCL usage with NIN Model (This requires you download the NIN Imagenet model files as described above):

<code>th neural_style.lua -style_image examples/inputs/picasso_selfport1907.jpg -content_image examples/inputs/brad_pitt.jpg -output_image profile.png -model_file models/nin_imagenet_conv.caffemodel -proto_file models/train_val.prototxt -gpu 0 -backend clnn -num_iterations 1000 -seed 123 -content_layers relu0,relu3,relu7,relu12 -style_layers relu0,relu3,relu7,relu12 -content_weight 10 -style_weight 1000 -image_size 512 -optimizer adam
</code>

OpenCL NIN Model Picasso Brad Pitt

To use multiple style images, pass a comma-separated list like this:

-style_image starry_night.jpg,the_scream.jpg.

Note that paths to images should not contain the ~ character to represent your home directory; you should instead use a relative path or a full absolute path.

more info here: GitHub – jcjohnson/neural-style: Torch implementation of neural style algorithm

Pinned onto ,

Related Pins

ESP8266 WeatherStation Color
ESP8266 WeatherStation Color
Keyless piano project using Arduino uno
Keyless piano project using Arduino uno
IoT Wardrobe
IoT Wardrobe
Automotive CAN Transceivers
Automotive CAN Transceivers
Restoring a vintage Xerox Alto day 8: it boots!
Restoring a vintage Xerox Alto day 8: it boots!
Sonicare toothbrush teardown: microcontroller, H bridge, and inductive charging
Sonicare toothbrush teardown: microcontroller, H bridge, and inductive charging
Reverse engineering a server CPU voltage regulator module
Reverse engineering a server CPU voltage regulator module
Building a sweet plastic MIDI controller
Building a sweet plastic MIDI controller
A DIY interactive book that uses digital gestures
A DIY interactive book that uses digital gestures
Arduino Stopwatch
Arduino Stopwatch
App note: General overview of IR transmission in free ambient
App note: General overview of IR transmission in free ambient
Sonicare toothbrush teardown: microcontroller, H bridge, and inductive charging
Sonicare toothbrush teardown: microcontroller, H bridge, and inductive charging
App note: Using Vishay infrared receivers in a Wi-Fi environment
App note: Using Vishay infrared receivers in a Wi-Fi environment
Skill Sunday: Uploading to your Arduino via a Network
Skill Sunday: Uploading to your Arduino via a Network
One Phase Power Meter
One Phase Power Meter
WiFi Toilet Vacancy Sensor
WiFi Toilet Vacancy Sensor
HAL 9000 reimagined as a useless machine
HAL 9000 reimagined as a useless machine
Using the XMEGA Clock System
Using the XMEGA Clock System
An Arduino VU meter for classrooms
An Arduino VU meter for classrooms
DIY Calculator
DIY Calculator

Top


Shares