资源算法MSG-Net

MSG-Net

2019-09-18 | |  59 |   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.

g1.jpgg2.jpgg3.jpgg4.jpgg5.jpgg6.jpgg7.jpgg8.jpgg9.jpg

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}
}
figure1.jpg

Stylize Images Using Pre-trained MSG-Net

  1. Download the pre-trained model bash python models/download_model.py

  2. Test the model bash python main.py eval --content-image images/content/venice-boat.jpg --style-image images/styles/candy.jpg --model models/21styles.params --content-size 1024

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

1.jpg2.jpg3.jpg4.jpg5.jpg6.jpg7.jpg8.jpg9.jpg

Train Your Own MSG-Net Model

  1. Download the COCO dataset bash bash dataset/download_dataset.sh

  2. Train the model bash python main.py train --epochs 4

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


上一篇:dni

下一篇:Highway Networks

用户评价
全部评价

热门资源

  • seetafaceJNI

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

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • inferno-boilerplate

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