Giter VIP home page Giter VIP logo

style_transfer's Introduction

style transfer with deep learning

APM

Requirements

python == 3.6
tensorflow == 1.10.0
numpy == 1.14.5

Usage

Frist, download all dependent files.

Please download slim vgg_16 check point from http://download.tensorflow.org/models/vgg_16_2016_08_28.tar.gz
Please download coco dataset from http://images.cocodataset.org/zips/val2017.zip

wget http://download.tensorflow.org/models/vgg_16_2016_08_28.tar.gz
wget http://images.cocodataset.org/zips/val2017.zip

Second, fit your transfer model.

python train.py --vgg_path "your vgg pre-trained path" --model_path "your transfer model path"
--style_image_path "choose one style image" --train_dataset "coco dataset path" --epoch 20
--batch_size 4 --learning_rate 0.001 --content_loss_weight 1.0 --style_loss_weight 100.0 --summary_path "summary path"

Third, you can use tensorboard to visual training process. you should access http://127.0.0.1:8888

tensorboard --logdir "your summary path" --port 8888

Last, you can use trained model to inference.

python inference.py --test_image "test image" --model_path "your transfer model path" --saved_path "transfromed image path"

NOTE:

1.I provide my trained model in this link: https://pan.baidu.com/s/1vgNb1sdfxVYXwLAtrv0ndw
2.You should fine tune the style_loss_weight, if you want to get a different style weights.

Results

Style image

Original image

Transformed image

style_transfer's People

Contributors

huangdaoxu avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.