Git Product home page Git Product logo

realtime-neural-style-transfer-with-tf-hub's Introduction

RealTime-Neural-Style-Transfer-with-TF-Hub

The repo creates a simple Tkinter GUI for Neural style transfer task. The core of the code is by using this Tensorflow Hub Model based on

@article{ghiasi2017exploring,
  title={Exploring the structure of a real-time, arbitrary neural artistic stylization network},
  author={Ghiasi, Golnaz and Lee, Honglak and Kudlur, Manjunath and Dumoulin, Vincent and Shlens, Jonathon},
  journal={arXiv preprint arXiv:1705.06830},
  year={2017}
}

The repo here only does forward prediction and there is no script for training or finetuning. For the latter, you will find tons of good resources online such as here or here.

The model can create stylized images/videos from your webcam, saved video or images. Though the code can run with a cpu, it is recommended that you run with a GPU, especially for the realtime rendering with webcam input. You may also use virtual camera tools to feed the rendered video from your webcam to your online meeting. For setups of these virtual camera tools on different platform, please refer to the relevant steps on this cool project: Avatarify.

Usage

  • Select the source of video/image for the input by the radio button at top.
  • Specify the desire size for the output.
  • For saved radios of images, type in the path of input files.
  • Type in the path to your style image to use.
  • If you want to save the rendered result, also type in the file name you want to save.

Some sample style images are included in ./style_images. If you want to use some other styles, just delete the default path and then specify the path to the image whose style you would like to transfer in the GUI entry. In a terminal, run python NST_GUI.py to launch the GUI.

Image examples

Web cam examples

Video examples here are done with cpu, so fps is low. A GPU will help get a true real time result.

Feel free to expand and develop upon this repo and have fun.

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.