Skip to content

pwang724/neural-style-transfer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neural Style Transfer

Simple tensorflow implementation of NST by Gatys and Bethge. Synthesizes a composite image with content specified by one image and style specified by another.

Details

Implementation of the original algorithm uses a pre-trained VGG19 network. Loosely inspired by this and this.

Content layer = [conv4_2]
Style layer = [conv1_1, conv2_1, conv3_1, conv4_1, and conv5_1]
Style weight = [.2, .2, .2, .2, .2]

"Style" is defined as a correlation matrix, where the **ij**th value of the matrix is dot product between the filtered images at depth i and depth j at a particular layer. Style loss is defined as the MSE between the correlation matrices of the input and style image at a particular layer.

"Content" is defined as the activations of a particular layer. Content loss is defined as the MSE between the activations of the input and content image for a particular layer. Total loss is defined as the weighted sum of style loss and content loss.

Example

Command
python stylize.py --content content_dir --style style_dir --model vgg19_dir --lr 1 --epoch 4000

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages