Coder Social home page Coder Social logo

kazuhito00 / movenet-python-example Goto Github PK

View Code? Open in Web Editor NEW
56.0 3.0 11.0 70.41 MB

MoveNetを用いたPythonでの姿勢推定のデモ

License: Apache License 2.0

Jupyter Notebook 28.63% Python 71.37%
movenet tensorflow tensorflow-lite onnx movenet-lightning movenet-thunder singlepose multipose

movenet-python-example's Introduction

MoveNet-Python-Example

MoveNetのPythonでの動作サンプルです。
ONNXに変換したモデルも同梱しています。変換自体を試したい方はMoveNet_tf2onnx.ipynbを使用ください。

smjqx-4ndt8

2021/08/24時点でTensorFlow Hubで提供されている以下モデルを使用しています。

Requirement

  • TensorFlow 2.3.0 or later
  • tensorflow-hub 0.12.0 or later
  • OpenCV 3.4.2 or later
  • onnxruntime 1.5.2 or later ※ONNX推論を使用する場合のみ

Demo

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

SignlePose

python demo_singlepose.py
  • --device
    カメラデバイス番号の指定
    デフォルト:0
  • --file
    動画ファイルの指定 ※指定時はカメラデバイスより優先
    デフォルト:指定なし
  • --width
    カメラキャプチャ時の横幅
    デフォルト:960
  • --height
    カメラキャプチャ時の縦幅
    デフォルト:540
  • --mirror
    VideoCapture()取り込みデータを左右反転するか否か
    デフォルト:指定なし
  • --model_select
    使用モデルの選択
    Saved Model, ONNX:0→Lightning 1→Thunder
    TFLite:0→Lightning(float16) 1→Thunder(float16) 2→Lightning(int8) 3→Thunder(int8)
    デフォルト:0
  • --keypoint_score
    キーポイント表示の閾値
    デフォルト:0.4

MultiPose

python demo_multipose.py
  • --device
    カメラデバイス番号の指定
    デフォルト:0
  • --file
    動画ファイルの指定 ※指定時はカメラデバイスより優先
    デフォルト:指定なし
  • --width
    カメラキャプチャ時の横幅
    デフォルト:960
  • --height
    カメラキャプチャ時の縦幅
    デフォルト:540
  • --mirror
    VideoCapture()取り込みデータを左右反転するか否か
    デフォルト:指定なし
  • --keypoint_score
    キーポイント表示の閾値
    デフォルト:0.4
  • --bbox_score
    バウンディングボックス表示の閾値
    デフォルト:0.2

Reference

Author

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

License

MoveNet-Python-Example is under Apache-2.0 License.

License(Movie)

サンプル動画はNHKクリエイティブ・ライブラリーストリートバスケットを使用しています。

movenet-python-example's People

Contributors

kazuhito00 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

movenet-python-example's Issues

Have you ever tried https://tfhub.dev/google/tfjs-model/movenet/multipose/lightning/1 ?

Hi, have you ever tried the model:
https://tfhub.dev/google/tfjs-model/movenet/multipose/lightning/1

which is a model in tfjs representation. I convert it to an onnx model using:
python3.6 -m tf2onnx.convert --opset 11 --tfjs model.json --output test.onnx --inputs-as-nchw input

where model.json is one of the extracted files from tfjs-model_movenet_multipose_lightning_1.tar.gz

Then I apply this onnx model to multipose detection, but the inference results are very bad. I compare the results with that of https://tfhub.dev/google/movenet/multipose/lightning/1 and they are pretty different. But I cannot find out the possible reason. Any suggestions? Thanks.

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.