Coder Social home page Coder Social logo

fullfanta / multimodal_transfer Goto Github PK

View Code? Open in Web Editor NEW
34.0 3.0 9.0 82.11 MB

tensorflow implementation of 'Multimodal Transfer: A Hierarchical Deep Convolutional Neural Network for Fast Artistic Style Transfer'

Python 98.87% Shell 1.13%
tensorflow resolution style-transfer

multimodal_transfer's Introduction

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

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

Train

To train network, I use MS coco dataset.

$ cd multimodal_style_transfer
$ bash get_coco.sh
  • downloaded image is in 'data/train2014'.

For stylization, pretrained VGG16 is necessary.

$ bash get_vgg16.sh

Then training is SIMPLE.

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

$ tensorboard --logdir=summary

Freeze model

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

Test

$ 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:
--model : freezed model path
--input_image : image file path to stylize
--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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.