0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ZED SDK で複数の検出タスクをこなす

Last updated at Posted at 2024-04-03

想定する読者

stereolabsのzed2, zed mini, zed x などのステレオカメラの利用者
いまどきのステレオカメラは何ができるのかを知りたい人

前提

ZED SDK 4.0
Ubuntu 20.04
ZED2i
Python 版のAPI

ZED SDK にある例題

https://github.com/stereolabs/zed-sdk/tree/master/object%20detection/concurrent%20detections
C++版です。
次のようにして、ビルド、実行できます。

cd "zed-sdk/object detection/concurrent detections/cpp"
mkdir build
cd build/
cmake ../CMakeLists.txt
make
./ZED_concurrent_detections

zed-concurrent-detections-python-proto

  • これはpythonによる実装です。
  • 物体検出のタスクとbody_parts の検出のタスクを同時にこなします。

複数の検出タスクが失敗するときに注意したいこと

  • 推論の実行の際に関係するinstance_module_id の値を複数のタスクで重ならないようにすること。
  • zed.retrieve_bodies() , zed.retrieve_objects() の3つめの引数が必要になることに注意しよう。
.py
obj_param = sl.ObjectDetectionParameters()
body_param = sl.BodyTrackingParameters()

中略

obj_param.instance_module_id = 0
body_param.instance_module_id = 1
zed.retrieve_bodies(bodies, body_runtime_param, body_param.instance_module_id)
zed.retrieve_objects(objects, obj_runtime_param, obj_param.instance_module_id)

公式のドキュメントについて

上記の公式のドキュメントでは、検出タスクが1つしか動作させていないため、3つめの引数を省略しても動作する。
そのため、3つめの引数についての記載がない。
help(zed.retrieve_bodies)
などとして、使い方にたどり着いてほしい。

ヒントになったStereoLabs のフォーラム

Concurrent custom Object Detection and Body Tracking

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?