This repository provides a Python implementation of Neural Style Transfer (by Gatys et al. (2015)) using Keras and the Tensorflow Adam optimizer.
The implementation comes with a streamlit application to provide a user-friendly interface that allows an easy selection of the training parameters as well as a convenient way to load input images, train, and explore the results.
Here is an example of running the app to transfer artistic features from the Starry Night to a picture of the Tokyo Tower.
Some of the obtained results:
You have the option to run this implementation on either CPU or GPU, but in both cases using Python 3.6. It is recommended to use the GPU option for more speedy results.
This is the easiest approach to run the app.
- Install the python requirements using pip, preferrably in a virtual environment:
pip install -r requirements.txt
- CMake: if you don't already have it, you'll need this to run the
Makefile
recipies
You can make sure that the installation is working by running the tests with
make cpu-test-run
This will train a lot faster than using CPUs.
- nvidia-docker2:
nvidia-docker2
will allow to build a container with all the GPU requirements for training - CMake: if you don't already have it, you'll need this to run the
Makefile
recipies
You can make sure that the installation is working by running the tests with
make gpu-test-run
In order to start the app, you just need to run a single command line from the root folder of this repository as follows:
- for running on CPU
make cpu-app
- for running on GPU
make gpu-app
See LICENSE for details.