Giter Site home page Giter Site logo

test's Introduction

Neural Style Transfer

This is a simple Jupyter Notebook which allows users to recombine the content and style of two arbitrary images, and capture the transition in the form of a gif. The algorithm used is based on the original paper, A Neural Algorithm of Artistic Style, and references this TensorFlow tutorial.

Adjustable Parameters

The notebook allows users to customise certain parameters to generate the desired output. These parameters are as follows:

  • style_path: path of the style image
  • content_path : path of the content image
  • feature_maps : Can be set to True/False. If True, the notebook will display and save sample feature maps of the convolutional layers used (refer to style_layers below for the specific layers used). Useful for investigating the features learned by the model when implementing the style transfer.
  • create_gif : Can be set to True/False. If True, the notebook will display and save a gif of the style transfer process.
  • gif_fps : Defines the frame per second (fps) of the output gif. Default set as 2.
  • plot_loss : Can be set to True/False. If True, the notebook will plot the graph of total variational loss vs epoch/steps.
  • style_layers and content_layers: The convolutional layers used to extract the style and content of the style and content images respectively. The default layers are based on the layers recommended in the original paper - 'block1_conv1','block2_conv1','block3_conv1','block4_conv1', and 'block5_conv1' for the style image, and 'block5_conv2' for the content image.
  • style_weight and content_weight : Weights which can be adjusted to customise the "amount" of style/content to transfer to the final image.
  • total_variation_weight : Can be adjusted to modify the rate of convergence of the total variation loss of the model.
  • opt : The optimizer used to train the model. The paper recommends LBFGS, but the Adam optimizer set as the default here works just as well.

Sample Images (1/2)

Content Image

Style Image

Output Gif

Image Error

Sample Images (2/2)

Content Image

Style Image

Output Gif

Image Error

test's People

Contributors

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