Giter Club home page Giter Club logo

neural-style-transfer's Introduction

NeuralStyleTransfer

A Neural Style Transfer based on VGG19 model

โญ Star this project on GitHub โ€” it helps!

Neural Style Transfer is a task of transferring style of one image to another. It does it by using features of some pretrained model. In this case as such Base Model the VGG19 pretrained on ImageNet was used. Firstly we create our own model from certain layers of the VGG19 network. And then by adding gradients from the network to the input image we obtain our result image with transferred style.

Table of content

Compiling model

As mentioned above, first of all we should compile our model from pretrained one. In this particular case the VGG19 was used. We should define between which of the layers the Content loss and Style loss are going to be calculated. As model's input is going to be the copy of content_image we do not need so much nodes to calculate Content loss as we need for Style loss(In this case 1 node was used for Content loss and 5 nodes for Style loss.

  • The model compiler is under model/__init__.py.

Training

Parameters of training:

  • Base model: VGG19
  • Content loss layer: conv4
  • Style loss layers: (conv1, conv2, conv3, conv4, conv5)
  • LBFGS optimizer
  • Number of epochs: 10

See demo for more details of training process.

  • The model trainer is under trainer.py.

Results

Van Gogh style

Content and Style Image

Content and Style loss

Result

Dali style

Content and Style Image

Content and Style loss

Result

License

This project is licensed under MIT.

Links

neural-style-transfer's People

Contributors

akanametov avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.