This is a TensorFlow implementation of A Neural Algorithm of Artistic Style using total variation denoising as a regularizer. A pretrained VGG network was used. It is provided here by machrisaa on GitHub. The VGG implementation was customized to accomodate the implementation requirements and is of the 19-layer variety.
Using this implementation, it is possible to emulate and achieve the same stylistic results as those in the original paper.
The purpose of this repository is to port the joint texture-synthesizing and representation-inverting stylistic-transfer algorithm to TensorFlow.
Style | Result |
---|---|
- Python 3.5
- TensorFlow (>= r1.0)
- scikit-image
- NumPy
To stylize an image, run:
python style_transfer.py path/to/input/image path/to/style/image --out path/to/output/image
The default paths for input, style, and output are "photo.jpg", "art.jpg", and "./" respectively.The first two files are supplied in this repository.
-
The main script where all the magic happens.
-
A modified implementation of the VGG 19 network. This particular customization changes the default pooling of max pooling to average pooling, which allows more effective gradient flow.
-
The weights used by the VGG network. This file is not in this repository due to its size. You must download it and place in the working directory. The program will complain and ask for you to download it with a supplied link if it does not find it.
-
Auxiliary routines for parsing images into numpy arrays used in the implementation.