项目作者: fullfanta

项目描述 :
tensorflow implementation of 'Multimodal Transfer: A Hierarchical Deep Convolutional Neural Network for Fast Artistic Style Transfer'
高级语言: Python
项目地址: git://github.com/fullfanta/multimodal_transfer.git
创建时间: 2017-04-06T07:19:21Z
项目社区:https://github.com/fullfanta/multimodal_transfer

开源协议:

下载


Style transfer

This is tensorflow implementation of ‘Multimodal Transfer: A Hierarchical Deep Convolutional Neural Network for Fast Artistic Style Transfer’ which generates stylized image in high resulution such as 1024 pixels.

Download program

  1. $ git clone https://github.com/fullfanta/multimodal_style_transfer.git

Train

To train network, I use MS coco dataset.

  1. $ cd multimodal_style_transfer
  2. $ bash get_coco.sh
  • downloaded image is in ‘data/train2014’.

For stylization, pretrained VGG16 is necessary.

  1. $ bash get_vgg16.sh

Then training is SIMPLE.

  1. $ python train.py
  • If you have multiple GPU cards, use CUDA_VISIBLE_DEVICES to specify GPU card.
  • Trained model is in summary.

During training, you can see generated images through tensorboard.

  1. $ tensorboard --logdir=summary

Freeze model

  1. $ sh freeze.sh 10000
  • parameter is iteration number among saved check point files.
  • It generates pb file which contains weights as contant.

Test

  1. $ python stylize.py --model=models/starry_night.pb --input_image=test_images/jolie.jpg
  • It generates hierarchical stylized images and save them to ‘test_images/jolie_output_1.jpg’, ‘test_images/jolie_output_2.jpg’, and ‘test_images/jolie_output_3.jpg’. Their sizes are 256, 512 and 1024 in short edge.
  • Parameters:
    1. --model : freezed model path
    2. --input_image : image file path to stylize
    3. --hierarchical_short_edges : three short edge length to generate images. (default is 256, 512, 1024)

Examples

Input Output(256px) Output(512px) Output(1024px)
Angelina Jolie
Dinosour
Ryan
Cheez
Herb

Acknowledgement