Tiny Art Exhibition: Style Transfer

The style of a selection of artists is imprinted onto everyday photographs using Nerual Style Transfer.

Unknown, Chi-Ching Lee

/style_transfer/comparison_72hqe2f.png

Illuminance, Rinko Kawauchi, 2011

/style_transfer/comparison_KVGvice.png

The Wassail, Charles Rennie MacKintosh, 1900

/style_transfer/comparison_charles-rennie-mackintosh-art-and-design-book-of-postcards-52.png

Norham Castle, Sunrise, Joseph M. W. Turner, 1845

/style_transfer/comparison_turner_-_norham_castle_sunrise_coco20001.png

Neural style transfer

What's happened to the photographs here as they are transformed to look like art works is known as neural style transfer.

This video and several after it in its playlist offer a good explanation on how neural style transfer works:

These videos describe the original neural style transfer method presented in A Neural Algorithm of Artistic Style. Many implementations of this method can be found.

The method used in this article is the one described in Perceptual Losses for Real-Time Style Transfer and Super-Resolution. Although the central idea, the perceptual loss, remains the same, an advantage of this method is that once the transform network is trained, it can be repeatedly used to style other images quickly, which can't be done using the original method. The paper also contains a clear description and comparison with the original method. There are numerous implementations of this method. A notable example is fast-neural-style from the official Pytorch examples. Similarly, Arbitrary Style Transfer in the Browser is a web app that lets you upload and transfrom your image in an instant.

Try it yourself

For the style transfer examples shown in this article, I wrote a Colab notebook that also serves as a step-by-step guide on how to implement neural style transfer. As it is, it can be run end-to-end to reproduce one of the examples. If you want to try on your own photographs or art works, this notebook guides you through it.


See also

comments powered by Disqus