An implementation of neural style in TensorFlow.
This implementation is a lot simpler than a lot of the other ones out there, thanks to TensorFlow's really nice API and automatic differentiation.
TensorFlow seems to be slower than a lot of the other deep learning frameworks out there. I'm sure this implementation could be improved, but it would probably take improvements in TensorFlow itself as well to get it to operate at the same speed as other implementations. As of now, it seems to be around 3x slower than implementations using Torch.
python neural_style.py --content <content file> --styles <style file> --output <output file>
python neural_style.py --help to see a list of all options)
Running it for 500-2000 iterations seems to produce nice results. With certain
images or output sizes, you might need some hyperparameter tuning (especially
The following example was run for 1000 iterations to produce the result (with default parameters):
These were the input images used (me sleeping at a hackathon and Starry Night):
The following example demonstrates style blending, and was run for 1000 iterations to produce the result (with style blend weight parameters 0.8 and 0.2):
The content input image was a picture of the Stata Center at MIT:
The style input images were Picasso's "Dora Maar" and Starry Night, with the Picasso image having a style blend weight of 0.8 and Starry Night having a style blend weight of 0.2:
- Pre-trained VGG network (MD5
Copyright (c) 2015 Anish Athalye. Released under GPLv3. See LICENSE.txt for details.