Code Monkey home page Code Monkey logo

a-neural-algorithm-of-artistic-style's Introduction

A Neural Algorithm of Artistic Style (Implementation)

An implementation of the arXiv preprint A Neural Algorithm of Artistic Style [1] & paper Image Style Transfer Using Convolutional Neural Networks [2].

Original Photograph: Tubingen, Germany


Claude Monet's Houses of Parliament

Pablo Picasso's Seated Nude

Edvard Munch's The Scream

Vincent van Gogh's The Starry Night

William Turner's The Shipwreck of The Minotaur

Wassily Kandinsky's Composition VII

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

  1. python3 - Programming Environment
  2. pip3 - Python Dependency Management

Installing

To install dependent modules:

pip3 install -r requirements.txt

Project Components

neural_stylization contains Python modules with utility methods and classes for the project.

VGG19

This project relies on the VGG19 architecture. VGG19-classification.ipynb outlines some basic image classification using the network with weight-set W pre-trained on the ImageNet dataset. The implementation of VGG19 can be found in neural_stylization/vgg19.py. Utility methods for loading manipulating, and normalizing image can be found in neural_stylization/img_util.py.

Content Reconstruction

content-reconstruction.ipynb describes the content reconstruction process from white noise. Performing gradient descent of the content loss on a white noise input x for a given content p yields a representation of the networks activation for a given layer l.

Style Reconstruction

style-reconstruction.ipynb describes the style reconstruction process from white noise. Performing gradient descent of the style loss on a white noise input x for a given artwork a yields a representation of the networks activation for a given set of layers L.

Style Transfer

style-transfer.ipynb describes the style transfer process between a white noise image x, a content image p, and a style representation a. Performing gradient descent of the content loss and style loss with respect to x impressions the content of p into x, bearing local styles, and colors from a.

Photo-Realistic Style Transfer

photo-realistic-style-transfer.ipynb describes the photo-realistic style transfer process. Opposed to transfering style from an artwork, this notebook explores transfering a nighttime theme from a picture of one city to a daytime picture of another city with mixed results.

Content Layer Selection

effect-of-content-layer.ipynb visualizes how the style transfer is affected by using different layers for content loss.

Style Layer Selection

effect-of-style-layers.ipynb visualizes how the style transfer is affected by using different sets of layers for style loss.

Optimizers

optimizers.ipynb employs gradient descent, adam, and L-BFGS to understand the affect of different blackbox optimizers. Gatys et. al use L-BFGS, but Adam appears to produce competetive results too.

Acknowledgments

  • keras-team provides Keras, a high level neural network framework. They also provide the pre-trained ImageNet weights and some tutorials that help build this project.

References

[1] L. A. Gatys, A. S. Ecker, and M. Bethge. A neural algorithm of artistic style. arXiv preprint arXiv:1508.06576, 2015.

[2] L. A. Gatys, A. S. Ecker, and M. Bethge. Image style transfer using convolutional neural networks. In Computer Vision and Pattern Recognition (CVPR), 2016 IEEE Conference on, pages 2414โ€“2423. IEEE, 2016.

a-neural-algorithm-of-artistic-style's People

Contributors

kautenja avatar rasoolianbehnam avatar dependabot[bot] avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.