LoginSignup
14
12

More than 3 years have passed since last update.

mediapipe hand trackingお試し

Last updated at Posted at 2019-10-02

mediapipeお試し

Hnad Trackingがヌルヌル動くニュース記事を見てちょっとお試し。基本スマホで動作させてる人が多かったけど、Mac環境で試している人はあまりいなかったので手順を記載。


(参照: https://ai.googleblog.com/2019/08/on-device-real-time-hand-tracking-with.html)

環境

  • PC: Mac Book Pro
  • OS: macOS Mojave 10.14.6

インストール

$ git clone https://github.com/google/mediapipe.git
$ cd mediapipe
  • bazelをinstall (手動でinstallでも可)
$ brew install bazel
  • opencv/ffmpegをinstall (依存があるようなので注意)
$ brew install opencv@3
  • hello world実行 (Hello Worldが出力されたOK)
$ export GLOG_logtostderr=1
$ bazel run --define MEDIAPIPE_DISABLE_GPU=1 \
    mediapipe/examples/desktop/hello_world:hello_world

Hand Trackingお試し

  • Hello World出来たら環境のインストール出来ているので次はHnad Trackingを動作させる
$ bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 \
    mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu

$ export GLOG_logtostderr=1
$ bazel-bin/mediapipe/examples/desktop/hand_tracking/hand_tracking_cpu \
    --calculator_graph_config_file=mediapipe/graphs/hand_tracking/hand_tracking_desktop_live.pbtxt

うまく実行したらカメラが起動するので手をかざすだけで反応する。かなり精度良い。ただ同時に認識するのは1つだけのよう。

スクリーンショット 2019-10-02 11.47.49.png
スクリーンショット 2019-10-02 11.47.59.png
スクリーンショット 2019-10-02 11.48.14.png

14
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
12