Giter Club home page Giter Club logo

simple_style_transfer's Introduction

simple_style_transfer

simple style transfer with a very clear code

Note

I have created a repo about style transfer several months ago.It is implemented referring to official tutorial. And its code may be a little hard to read and understand.However,this code is very simple and clear,and has a lot of tricks.You may understand them and use them in your own porjects.

Usage

git clone https://github.com/cryer/simple_style_transfer.git
cd simple_style_transfer
pip install -r requirements.txt
python train.py train

Add additional configs:

    --content = './image/gakki.jpeg'
    --style = './image/in1.png'
    --max_size = 400
    --total_step = 5000
    --log_step = 10
    --sample_step = 1000
    --style_weight = 100
    --lr = 0.003
    --use_gpu = True

Pay attention to images' path.

Results

Use my idol gakki to do a test.

本当に かわいいねww 女はみずだ!

content image style image transfer image

Difference

Compare to my previous style transfer repo or official implementation,this repo's computation of content loss is different. Using five layers' content loss togeter instead of only one layer's content loss in paper and official implementation.So it may take longer time,but a little bit improvement a think,because if it improves a lot , paper may likely use this kind of loss. You can change loss computation part to do a test.

Reference

Yunjey,Yunjey's code is always very clear,you may learn a lot from him.

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.