Code Monkey home page Code Monkey logo

fun-neural-style-transfer's Introduction

fun-neural-style-transfer

I'm very bored! I don't know how long it would take to complete (I meant, my new model)! So, I suppose I need to have something to do! This project sounds fun and exciting ๐Ÿคฉ, and a little bit needs some different configurations, which I'm going to show you how to do it! Stay tuned!

How to use?

Open your terminal and follow the process step by step.

git clone https://github.com/m3hrdadfi/fun-neural-style-transfer.git app
cd app

python transfer.py \
    --language pt \
    --content_image_path SPECIFY_YOUR_CONTENT_IMAGE_PATH \
    --content_type d \
    --style_image_path SPECIFY_YOUR_STYLE_IMAGE_PATH \
    --style_type e \
    --log_every_step 500 \
    --steps 4000 \
    --learning_rate 1e-3 \
    --style_weights 0.2,0.2,0.2,0.2,0.2 \
    --alpha 8.0 \
    --beta 1e4 \
    --save_dir SPECIFY_YOUR_OUTPUT_DIR

For more information

python transfer.py --h

Output

usage: transfer.py [-h] --content_image_path CONTENT_IMAGE_PATH
                   [--content_type CONTENT_TYPE] --style_image_path
                   STYLE_IMAGE_PATH [--style_type STYLE_TYPE] --language
                   LANGUAGE [--style_weights STYLE_WEIGHTS] [--alpha ALPHA]
                   [--beta BETA] [--steps STEPS]
                   [--log_every_step LOG_EVERY_STEP]
                   [--learning_rate LEARNING_RATE] [--save_dir SAVE_DIR]
                   [--seed SEED]

optional arguments:
  -h, --help            show this help message and exit
  --content_image_path CONTENT_IMAGE_PATH
                        The content image path as p (picture)
  --content_type CONTENT_TYPE
                        The content type must be in the list: a, b, c, d, e
  --style_image_path STYLE_IMAGE_PATH
                        The style image path as a (artwork)
  --style_type STYLE_TYPE
                        The style type must be in the list: a, b, c, d, e
  --language LANGUAGE   Language name selected in the list: pt, tf
  --style_weights STYLE_WEIGHTS
                        Style weights must be declared as list of int for all
                        layers: conv1_1, conv2_1, conv3_1, conv4_1, conv4_1
  --alpha ALPHA
  --beta BETA
  --steps STEPS
  --log_every_step LOG_EVERY_STEP
  --learning_rate LEARNING_RATE
  --save_dir SAVE_DIR
  --seed SEED           random seed for initialization

asciicast

Notebook Example regarding how to use transfer.py script

Open In Colab

Final Result

Neural Style Transfer (NST) depends on two entities, a content and a style. It accepts one pair of images, one as content and the other as a styler. Then, it produces a new target that preserves the content and tries to shift the style of primary into the styler. In summary:

  • Content image used as a basis that provides objects and arrangements for the target.
  • Style image used as a painter (styler) to transfer its style, colors, and textures to the target image.

Content and Style

Content - Style

Target (as a fruit of NST)

Content - Style

Copyright

License

This project is entirely free and open-source and licensed under the Apache 2.0 license.

fun-neural-style-transfer's People

Contributors

m3hrdadfi avatar

Watchers

 avatar  avatar

Forkers

gaybro8777

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.