/mxnet-fast-neural-style

A simple implementation of fast neural style transfer in mxnet

Primary LanguagePythonApache License 2.0Apache-2.0

mxnet-fast-neural-style

A mxnet implementation of fast style transfer, inspired by:

releated papers:

example

We added styles from various paintings to a photo of Chicago. Click on thumbnails to see full applied style images.




some pretrained model you can find in checkpoints directory.

Prerequisites

  1. MXNet
  2. Pretrained VGG19 params file : vgg19.params
  3. Training data if you want to train your own models. The example models is trained on MSCOCO [Download Link](about 12GB)

Usage

Training Style Transfer Networks

python train.py --style-image path/to/style/img.jpg \
  --checkpoint-dir path/to/save/checkpoint \
  --vgg-path path/to/vgg19.params \
  --content-weight 1e2 \
  --style-weight  1e1 \
  --epochs 2 \
  --batch-size 20 \
  --gpu 0

for more detail see the help information of train.py

python train.py -h

Transform images

python transform.py --in-path path/to/input/img.jpg \
  --out-path path/dir/to/output \
  --checkpoint path/to/checkpoint/params \
  --resize 720 480 \
  --gpu 0

for more detail see the help information of transform.py

python transform.py -h