Skip to content

An S2I builder for neural-style training and painting with Tensorflow!

Notifications You must be signed in to change notification settings

sub-mod/tensorflow-neural-style-s2i

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neural-Style S2I

About

Neural Style, as outlined by Gatys, Ecker and Bethge in A Neural Algorithm of Artistic Style, 2015, is a method of training convultional neural nets to produce images that can stylistically mimic paintings. Specifically, a content image is painted in the style of style image, so for example, you can take your favorite selfie (the content image) and paint it in the style of Van Gogh's Starry Night (the style image). For some great examples, check out this document by Logan Engstrom.

This implementation is based off of a neural-style implementation by Anish Athalye, with some minor edits to his code. More on that here.

Options

  • STYLE_URL: The URL at which your desired style image lives.
  • CONTENT_URL: The URL at which your desired content image lives.
  • MODEL_URL: If you already have a .ckpt file from a previous run of neural-style, you can point to it here.
  • WIDTH: The width of your output image. Height is automatically adjusted to maintain aspect ratio.
  • ITERATIONS: The number of iterations to train over.

Larger values of WIDTH and ITERATIONS will increase the quality of the output image at the expense of greater training time.

Usage

oc create template -f https://raw.githubusercontent.com/RobGeada/neural-style-s2i/master/template.json

To train with default image settings (style=Great Wave off Kanagawa, content=Chicago Skyline, width=1000, iterations=1000):

oc new-app --template neural-style

To train with custom images:

oc new-app --template neural-style --param=STYLE_URL=[url of style image] --param=CONTENT_URL=[url of content image] --param=WIDTH=1000 --param=ITERATIONS=1000

To evaluate a pre-trained model:

oc new-app --template neural-style --param=STYLE_URL=[url of style image] --param=CONTENT_URL=[url of content image] --param=MODEL_URL=[url of model] --param=WIDTH=1000 --param=ITERATIONS=1000

Using Pre-Trained Models

Due to how this implementation of neural-style works, pre-trained models will only work when provided with the exact same pair of content and style images.

License

The original neural-style code upon which this is based is copyright, the details of which have been provided below.

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

About

An S2I builder for neural-style training and painting with Tensorflow!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 97.1%
  • Makefile 2.9%