Neural-style transfer (NST) using Tensorflow.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Neural-style transfer (NST) algorithm implementation using Tensorflow.

Using Neural-Stylr

Neural-stylr can be used by cloning this project, or by running a demo Docker image.


With Cloned Project

Clone the project

git clone
cd neural-stylr

Download pretrained model


Download any desired images to model/images/input/. There is a starter-pack of images already in the input folder that can be used for exploration.

The vgg19 model takes input images sized 300x400. Input images of any other size will be automatically resized and center-cropped to the default aspect-ratio. Output images will be 300x400.

Next, build a Docker image with the necessary dependencies.

# Image is built for gpu-support by default

# Add flag -c for to use CPU instead
./model/scripts/ -c

Run Docker image.

# Image is built for gpu-support by default

# Add flag -c to use CPU instead
./model/scripts/ -c

Change to model directory.

cd model

With Demo Docker Image

Run demo image hosted on Docker Hub

# GPU demo image
docker run --rm --runtime nvidia -u $(id -u):$(id -g) -it dget/dock-stylr:gpu-demo

# CPU demo image
docker run --rm -u $(id -u):$(id -g) -it dget/dock-stylr:demo


Once set up, run and enjoy.

# Run stylr algorith using default images and settings

# See parameter options
python -h

# Make a beautiful kandinsky-hummingbird-sphinx-moth
python \
    -c images/input/hummingbird-sphinx-moth-small.jpg \
    -g images/input/wassily-kandinsky-romantic-landscape-1911-small.jpg \
    -s 0.25 -r 2.5 -a 30 -w 0.1 0.1 0.1 0.1 0.1


Here are a few of my favorite creations. More can be found in assets/examples - along with the configurations used to create them.

Style Content NST