资源算法MXNet-Gluon-Style-Transfer

MXNet-Gluon-Style-Transfer

2020-02-10 | |  36 |   0 |   0

MXNet-Gluon-Style-Transfer

This repo has been included in official MXNet repo, which provides the implementations of MSG-Net and Neural Style Transfer. We also provide PyTorch and Torch implementations.

Tabe of content

Neural Style

A Neural Algorithm of Artistic Style by Leon A. Gatys, Alexander S. Ecker, and Matthias Bethge.

python main.py optim --content-image images/content/venice-boat.jpg --style-image images/styles/candy.jpg
  • --content-image: path to content image.

  • --style-image: path to style image.

  • --output-image: path for saving the output image.

  • --content-size: the content image size to test on.

  • --style-size: the style image size to test on.

  • --cuda: set it to 1 for running on GPU, 0 for CPU.


图片.png

Real-time Style Transfer

Multi-style Generative Network for Real-time Transfer [arXiv] [project]
Hang ZhangKristin Dana
@article{zhang2017multistyle,
	title={Multi-style Generative Network for Real-time Transfer},
	author={Zhang, Hang and Dana, Kristin},
	journal={arXiv preprint arXiv:1703.06953},
	year={2017}
}

图片.png

Stylize Images Using Pre-trained MSG-Net

  1. Download the pre-trained model

    python models/download_model.py
  2. Test the model

    python main.py eval --content-image images/content/venice-boat.jpg --style-image images/styles/candy.jpg --model models/21styles.params --content-size 1024
  • If you don't have a GPU, simply set --cuda=0. For a different style, set --style-image path/to/style. If you would to stylize your own photo, change the --content-image path/to/your/photo. More options:

    • --content-image: path to content image you want to stylize.

    • --style-image: path to style image (typically covered during the training).

    • --model: path to the pre-trained model to be used for stylizing the image.

    • --output-image: path for saving the output image.

    • --content-size: the content image size to test on.

    • --cuda: set it to 1 for running on GPU, 0 for CPU.

      图片.png

Train Your Own MSG-Net Model

  1. Download the COCO dataset

    bash dataset/download_dataset.sh
  2. Train the model

    python main.py train --epochs 4
  • If you would like to customize styles, set --style-folder path/to/your/styles. More options:

    • --style-folder: path to the folder style images.

    • --vgg-model-dir: path to folder where the vgg model will be downloaded.

    • --save-model-dir: path to folder where trained model will be saved.

    • --cuda: set it to 1 for running on GPU, 0 for CPU.

The code is mainly modified from PyTorch-Style-Transfer.


上一篇:Feed-Forward-Style-Transfer

下一篇:fast-style-transfer-tutorial-pytorch

用户评价
全部评价

热门资源

  • 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...