Member-only story

Transforming Pictures with Neural Style Transfer in iOS

Navdeep Singh
7 min readJul 3, 2018

Since deep neural networks took off in 2012 with the winning ImageNet challenge of AlexNet, AI researchers have been applying deep learning technology, including pre-trained deep CNN models, to more and more problem domains. What can be more creative than creating art?

One idea that has been proposed and implemented, called neural style transfer, allows you to take advantage of a pre-trained deep neural network model and to transfer the style of an image, or any Van Gogh or Monet masterpiece, for example, to another image such as your profile picture or a picture of your favourite dog, thereby creating an image that mixes the content of your picture and the style of a masterpiece.

There’s actually an iOS app called Prisma that won Best App of the Year in 2016 that does just that; in just a few seconds, it transforms your pictures with any of the styles you choose.

In this article, you will look at how to train a fast neural style transfer model that can be used in your iOS to achieve what Prisma does.

Training fast neural-style transfer models

In this section, follow these steps to learn how to train a model using the fast neural-style transfer algorithm with TensorFlow:

  1. On a Terminal of your Mac or preferably GPU-powered Ubuntu, run git clone this Github repo, which is a fork of a nice TensorFlow implementation of Johnson's fast-style transfer, modified to allow…

--

--

Navdeep Singh
Navdeep Singh

Written by Navdeep Singh

Author of Reactive programming with Swift, Engineering Manager — Exploring possibilities with new Tech.

Responses (2)