资源算法fast-style-transfer

fast-style-transfer

2019-09-19 | |  130 |   0 |   0

mxnet-fast-neural-style

A mxnet implementation of fast style transfer, inspired by: - https://github.com/lengstrom/fast-style-transfer - https://github.com/zhaw/neural_style - https://github.com/dmlc/mxnet/tree/master/example/neural-style

releated papers: - Johnson's Perceptual Losses for Real-Time Style Transfer and Super-Resolution - Ulyanov's Instance Normalization

example

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

sunrise.jpgThe_Great_Wave_off_Kanagawa.jpgguangzhou_tower.jpgguangzhou_tower-sunrise.jpgguangzhou_tower-wave.jpgriver_night-sunrise.jpgcloud_sea.jpgcloud_sea-sunrise.jpgcloud_sea-wave.jpg

some pretrained model you can download here

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](http://msvocds.blob.core.windows.net/coco2014/train2014.zip)

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


上一篇:RangeLoss

下一篇:VisualBackProp

用户评价
全部评价

热门资源

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • inferno-boilerplate

    This is a very basic boilerplate example for pe...