Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/SineYuan/mxnet-fast-neural-style
A simple implementation of fast neural style transfer in mxnet
https://github.com/SineYuan/mxnet-fast-neural-style
mxnet neural-style python
Last synced: 2 months ago
JSON representation
A simple implementation of fast neural style transfer in mxnet
- Host: GitHub
- URL: https://github.com/SineYuan/mxnet-fast-neural-style
- Owner: SineYuan
- License: apache-2.0
- Created: 2017-03-19T18:14:50.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-03-11T04:52:26.000Z (almost 6 years ago)
- Last Synced: 2024-08-01T22:41:38.043Z (5 months ago)
- Topics: mxnet, neural-style, python
- Language: Python
- Homepage:
- Size: 23.3 MB
- Stars: 7
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-MXNet - fast-style-transfer
README
# mxnet-fast-neural-style
A mxnet implementation of fast style transfer, inspired by:
- [https://github.com/lengstrom/fast-style-transfer](https://github.com/lengstrom/fast-style-transfer)
- [https://github.com/zhaw/neural_style](https://github.com/zhaw/neural_style)
- [https://github.com/dmlc/mxnet/tree/master/example/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](http://cs.stanford.edu/people/jcjohns/eccv16/)
- Ulyanov's [Instance Normalization](https://arxiv.org/abs/1607.08022)## 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](https://github.com/dmlc/mxnet/)
2. Pretrained VGG19 params file : [vgg19.params](https://github.com/dmlc/web-data/raw/master/mxnet/neural-style/model/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)](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
```