Giter Club home page Giter Club logo

mediapipe-python-sample's Introduction

mediapipe-python-sample

MediaPipeのPythonパッケージのサンプルです。
2021/05/12時点でPython実装のある以下6機能について用意しています。

Requirement

  • mediapipe 0.8.4.2 or later
  • OpenCV 3.4.2 or later

mediapipeはpipでインストールできます。

pip install mediapipe

Demo

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

Face Mesh

python sample_facemesh.py
  • --device
    カメラデバイス番号の指定
    デフォルト:0
  • --width
    カメラキャプチャ時の横幅
    デフォルト:960
  • --height
    カメラキャプチャ時の縦幅
    デフォルト:540
  • --max_num_hands
    最大手検出数
    デフォルト:1
  • --min_detection_confidence
    検出信頼値の閾値
    デフォルト:0.5
  • --min_tracking_confidence
    トラッキング信頼値の閾値
    デフォルト:0.5
  • --use_brect
    外接矩形を描画するか否か
    デフォルト:指定なし

Hands

python sample_hand.py
  • --device
    カメラデバイス番号の指定
    デフォルト:0
  • --width
    カメラキャプチャ時の横幅
    デフォルト:960
  • --height
    カメラキャプチャ時の縦幅
    デフォルト:540
  • --max_num_faces
    最大顔検出数
    デフォルト:1
  • --min_detection_confidence
    検出信頼値の閾値
    デフォルト:0.7
  • --min_tracking_confidence
    トラッキング信頼値の閾値
    デフォルト:0.5
  • --use_brect
    外接矩形を描画するか否か
    デフォルト:指定なし

Pose

python sample_pose.py
  • --device
    カメラデバイス番号の指定
    デフォルト:0
  • --width
    カメラキャプチャ時の横幅
    デフォルト:960
  • --height
    カメラキャプチャ時の縦幅
    デフォルト:540
  • --model_complexity
    モデルの複雑度(0:Lite 1:Full 2:Heavy)
    ※性能差はPose Estimation Qualityを参照ください
    デフォルト:1
  • --min_detection_confidence
    検出信頼値の閾値
    デフォルト:0.5
  • --min_tracking_confidence
    トラッキング信頼値の閾値
    デフォルト:0.5
  • --use_brect
    外接矩形を描画するか否か
    デフォルト:指定なし

Holistic

python sample_holistic.py
  • --device
    カメラデバイス番号の指定
    デフォルト:0
  • --width
    カメラキャプチャ時の横幅
    デフォルト:960
  • --height
    カメラキャプチャ時の縦幅
    デフォルト:540
  • --model_complexity
    モデルの複雑度(0:Lite 1:Full 2:Heavy)
    ※性能差はPose Estimation Qualityを参照ください
    デフォルト:1
  • --min_detection_confidence
    検出信頼値の閾値
    デフォルト:0.5
  • --min_tracking_confidence
    トラッキング信頼値の閾値
    デフォルト:0.5
  • --use_brect
    外接矩形を描画するか否か
    デフォルト:指定なし

Face Detection

python sample_facedetection.py
  • --device
    カメラデバイス番号の指定
    デフォルト:0
  • --width
    カメラキャプチャ時の横幅
    デフォルト:960
  • --height
    カメラキャプチャ時の縦幅
    デフォルト:540
  • --min_detection_confidence
    検出信頼値の閾値
    デフォルト:0.5

Objectron

python sample_objectron.py
  • --device
    カメラデバイス番号の指定
    デフォルト:0
  • --width
    カメラキャプチャ時の横幅
    デフォルト:960
  • --height
    カメラキャプチャ時の縦幅
    デフォルト:540
  • --static_image_mode
    静止画像モード ※トラッキング無し
    デフォルト:指定なし
  • --min_detection_confidence
    検出信頼値の閾値
    デフォルト:0.5
  • --min_tracking_confidence
    トラッキング信頼値の閾値
    デフォルト:0.99
  • --model_name
    検出対象(20201/03/03時点:'Shoe', 'Chair', 'Cup', 'Camera'の4種類)
    デフォルト:Cup

ToDo

  • Holisticのサンプル追加 (mediapipe 0.8.1)
  • Poseのz座標表示を追加 (mediapipe 0.8.3)
  • Face Detectionのサンプル追加 (mediapipe 0.8.3)
  • Objectronのサンプル追加 (mediapipe 0.8.3)

Reference

Author

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

License

mediapipe-python-sample is under Apache-2.0 License.

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

mediapipe-python-sample's People

Contributors

kazuhito00 avatar

Watchers

James Cloos avatar

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.