Giter Site home page Giter Site logo

artsy's Introduction

Artsy

Maintainability Codacy Badge

Artsy is a Neural Style Transfer Art Generation implementation in less than 200 lines of code using TensorFlow.

Neural Style Transfer is a fairly exciting and fun application of Deep Learning, as it can generate quite genuine and clever looking artistic transmutations of an ordinary photograph by augmenting onto it the artistic style of any painting of your liking. So essentially, we can train a network to transform any image into a stylized version of it, based on the style of our handpicked image. That is incredible! In case you were wondering, this technology is exactly how apps like Prisma work.

Here are a few output examples of the “Neckarfront” in Tubingen, Germany in various styles of a few famous impressionist paintings as cited in the NST paper:

“Neckarfront”, Tubingen, Germany in various styles of different paintings

Steps

  1. Load the style and content images
  2. Randomly initialize the generated image
  3. Load the VGG-19 model with the correct configuration
  4. Build the computation graph:
    • Run the content image through the VGG-19 model and compute the content cost
    • Run the style image through the VGG-19 model and compute the style cost
    • Compute the total cost
    • Define the optimizer and the learning rate
  5. Initialize and run the graph for a number of iterations:
    • Update the generated image at every step

Data

Neural Style Transfer (NST) uses a previously trained Convolutional Neural Network, and builds on top of that. This concept of using a network trained on a different task (such as Object Detection and Recognition) and applying it to a new task is called Transfer Learning.

As per the original paper - A Neural Algorithm of Artistic Style, we will use the VGG network. Specifically, we'll use VGG-19, a 19-layer version of the VGG network. This model has already been trained on the very large ImageNet database, and thus has learned to recognize a variety of low level features (at the earlier layers) and high level features (at the deeper layers).

The VGG-19 (imagenet-vgg-verydeep-19.mat) model can be downloaded from here.

Getting Started

In order to be able to generate neural style artistic images, you will need to install the required python packages:

pip install -r requirements.txt

Now you can open up a terminal and run the model on your images:

python main.py --num-iters 500 --save-every 50

Now you are all set up!

Results

Content: Arc De Triomphe in Paris, France

Style: "The Starry Night" by Vincent van Gogh



Content: Taj Mahal in Agra, India

Style: Impression, Sunrise by Claude Monet



Content: New York City skyline

Style: Antibes Seen by Claude Monet

Built With

  • Python
  • TensorFlow

artsy's People

Contributors

pskrunner14 avatar codacy-badger 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.