Giter Site home page Giter Site logo

kazuhito00 / animeganv2-onnx-sample Goto Github PK

View Code? Open in Web Editor NEW
63.0 5.0 12.0 8.63 MB

「PyTorch Implementation of AnimeGANv2」のPythonでのONNX推論サンプル

License: MIT License

Jupyter Notebook 99.66% Python 0.34%
animeganv2 pytorch onnx colaboratory onnxruntime-gpu

animeganv2-onnx-sample's Introduction

AnimeGANv2-ONNX-Sample

 
PyTorch Implementation of AnimeGANv2のPythonでのONNX推論サンプルです。
ONNXに変換したモデルも同梱しています。
変換自体を試したい方はColaboratoryなどでAnimeGANv2_Convert2ONNX.ipynbを使用ください。

Requirement(ONNX変換)

  • Pytorch 1.9.0 or later
  • onnx 1.10.2 or later
  • onnx-simplifier 0.3.6 or later

Requirement(ONNX推論)

  • OpenCV 4.5.3.56 or later
  • onnxruntime-gpu 1.9.0 or later
    ※onnxruntimeでも動作しますが、推論時間がかかるのでGPUをお勧めします

推論速度参考値

GeForce GTX 1050 Ti:約290ms
GeForce RTX 3060:約120ms

Demo

デモの実行方法は以下です。

python sample_onnx.py
  • --device
    カメラデバイス番号の指定
    デフォルト:0
  • --movie
    動画ファイルの指定 ※指定時はカメラデバイスより優先
    デフォルト:指定なし
  • --width
    カメラキャプチャ時の横幅
    デフォルト:960
  • --height
    カメラキャプチャ時の縦幅
    デフォルト:540
  • --model
    ロードするモデルの格納パス
    デフォルト:model/face_paint_512_v2_0.onnx
  • --input_shape
    モデルの入力サイズ
    デフォルト:512

Application example

応用例です。

Reference

Author

高橋かずひと(https://twitter.com/KzhtTkhs)

License

AnimeGANv2-ONNX-Sample is under MIT License.

License(Image)

女性の画像はフリー素材ぱくたそ様の写真を利用しています。

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.