This repository includes:
- A library of building blocks for state-of-the-art image synthesis.
- Reference implementations of popular deep learning algorithms.
In the examples folder, you'll find a documented implementation of neural style transfer based on the following:
- A Neural Algorithm of Artistic Style, Gatys et al. 2015.
- Improving the Neural Algorithm of Artistic Style, Novak & Nikulin, 2016.
- Stable and Controllable Neural Synthesi, Risser et al, 2017.
python examples/iterative.py --style texture.png --output-size 256x256 --output generated1.png
python examples/iterative.py --content image.png --output generated2.png
python examples/iterative.py --content image.png --style texture.png --output generated3.png
You will likely need to experiment with the default options to obtain good results:
--scales=N
: Coarse-to-fine rendering with downsampled images.--iterations=N
: Number of steps to run the optimizer at each scale.--style-layers A B C D
: Specify convolution layers of VGG19 manually, by default1 6 11 20 29
forrelu*_1
.--style-weights a b c d
: Override loss weights for style layers, by default1.0
for each.--content-layers E F
: Specify convolution layers of VGG19 manually, by default20
forrelu4_1
.--content-weights e f
: Override loss weight for content layers, by default1.0
.--seed image.png
: Provide a starting image for the optimization.