Skip to content

benbenlijie/style_swap_tensorflow

Repository files navigation

Fast Patch-based Style Transfer of Arbitrary Style

Paper: https://arxiv.org/abs/1612.04337

Examples

Preparetion

Download VGG16 model from Tensorflow Slim. Extract the file vgg_16.ckpt. Then copy it to the folder pretrained/

Usage

Stylizing images:

python main.py -c config/example.json -s --content images/content/*.jpg --style images/style/style_1_image_60.png

Video stylization

python main.py -c config/example.json -s --content videos/timelapse1_orig.mp4 --style images/style/style_1_image_60.png

Training an inverse network

python main.py -c config/example.json

Style swap

Φ(.) is the function represented by a fully convolutional part of a pretrained CNN that maps an image from RGB to some intermediate activation space. So Φ(C) is the activation of content, and Φ(S) is the activation of style.

Extract a set of patches for Φ(C) and Φ(S). The target of "Style Swap" is to find a closest-matching style patch for each content patch, and replace it.

About

tensorflow code for Fast Patch-based Style Transfer of Arbitrary Style

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages