Git Product home page Git Product logo

neural_style_tf's Introduction

Neural style in Tensorflow

A Tensorflow implementation of the following papers:

Feed forward
Back propagation

This repository is an effort to learn CNN and neural style. As a result, some parts of the code could be poorly named, not commented, or even buggy. It's also my first attempt to submit a project unrelated to any course work on Github. So please bear with me (and my code).

Note that some of the code and images was taken and adapted from code on other neural style related git repo online. I did my best to cite every source I've used, but in case I missed anything or if you're one of the authors and would not like your code to be used in this repo, please let me know.

Back propagation examples

The following examples comes from stylize_example.py in the repo.

Style Transfer

This is the output of the classic neural style algorithm described in "A Neural Algorithm of Artistic Style". Here it takes one content image and one style image and merge the two so that the outcome describe the same scene but with a different artistic "style".

Texture Synthesis

This used essentially the same algorithm in "A Neural Algorithm of Artistic Style" but without a content image. As a result, the output showed the texture features of the style image.

Multiple style transfer

This output is made from weighing Van Gogh's "starry sky" style by 70% and Picasso's "mind, spirit and emotion" by 30%.

Using Markov Random Fields

This one is achieved by using the MRF loss mentioned in this paper on two images with similar content but different "style". The result is the original day view of Tokyo turned into the same scene during a sunset.

MRF with semantic masks

In the same paper, the authors also take use of semantically labeled image for style transfer and they got some interesting result, which is repeated here.

Style weight mask

This one is a simple improvement I made to the neural style. When I was using the program, I found that sometimes the program stylize one part of image a little bit too much than what I want but some other parts a little bit less. With the help of what I call 'style weight mask' (in black and white), one can control the degree of stylization for every single pixel.

The images from left to right are: content image, style weight mask, output, style image.

Feed forward examples

The following examples comes from feed_forward_neural_style_examples.py in the repo.

Multi style feed forward network

Original image:

ModelName Style Samples
starry sky
mind, spirit and emotion
composition_v
feathers
la_muse
mosaic
the scream
udnie
wave

These are just some examples. With more training time, the results can be better. (Some style images are taken from here)

Neural doodle

TODO: IMAGE MISSING. For now check this blog for sample images.

I basically reimplemented the feed-forward version of the neural doodle, which allows anyone to paint like a real artist within minutes.

Future plans

  • I have yet to implement the style transfer without changing the color of the content image.
  • It would be fun if I can improve the neural doodle so that it can draw more semantically complicated things. I've only tried it on paintings on natural scenery.

Requirements

  • Tensorflow
  • Anaconda Python 2.7
  • typing
  • Opencv

Other information

neural_style_tf's People

Contributors

jerryli27 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  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.