Coder Social home page Coder Social logo

aruppcb / neural-style Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anishathalye/neural-style

0.0 2.0 0.0 1.82 MB

Neural style in TensorFlow! :art:

Home Page: http://www.anishathalye.com/2015/12/19/an-ai-that-can-mimic-any-artist/

License: GNU General Public License v3.0

Python 100.00%

neural-style's Introduction

neural-style

An implementation of neural style in TensorFlow.

This implementation is a lot simpler than a lot of the other ones out there, thanks to TensorFlow's really nice API and automatic differentiation.

TensorFlow doesn't support L-BFGS (which is what the original authors used), so we use Adam. This may require require a little bit more hyperparameter tuning to get nice results.

TensorFlow seems to be slower than a lot of the other deep learning frameworks out there. I'm sure this implementation could be improved, but it would probably take improvements in TensorFlow itself as well to get it to operate at the same speed as other implementations. As of now, it seems to be around 3x slower than implementations using Torch.

Running

python neural_style.py --content <content file> --styles <style file> --output <output file>

(run python neural_style.py --help to see a list of all options)

Example 1

Running it for 500-2000 iterations seems to produce nice results. With certain images or output sizes, you might need some hyperparameter tuning (especially --content-weight, --style-weight, and --learning-rate).

The following example was run for 1000 iterations to produce the result (with default parameters):

output

These were the input images used (me sleeping at a hackathon and Starry Night):

input-content

input-style

Example 2

The following example demonstrates style blending, and was run for 1000 iterations to produce the result (with style blend weight parameters 0.8 and 0.2):

output

The content input image was a picture of the Stata Center at MIT:

input-content

The style input images were Picasso's "Dora Maar" and Starry Night, with the Picasso image having a style blend weight of 0.8 and Starry Night having a style blend weight of 0.2:

input-style input-style

Requirements

License

Copyright (c) 2015-2016 Anish Athalye. Released under GPLv3. See LICENSE.txt for details.

neural-style's People

Contributors

anishathalye avatar akx avatar

Watchers

James Cloos avatar Arup Basak 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.