homuler / MediaPipeUnityPlugin

Unity plugin to run MediaPipe
MIT License
1.76k stars 460 forks source link

How to get localObjectDetection id,distinguish different Detections. #1228

Closed tisaud closed 3 weeks ago

tisaud commented 1 month ago

Plugin Version or Commit ID

v0.14.4

Unity Version

2021.3.18f

Your Host OS

Windows10 home

Target Platform

UnityEditor, Windows Standalone

Description

I want to get localObjectDetection id to distinguish different Detections,but DetectionId is always 0,TrackId and LabelId are always empty,can you help me fix this.

Code to Reproduce the issue

No response

Additional Context

No response

homuler commented 1 month ago

Please specify which solution (or calculators in case you have implemented custom CalculatorGraph) you are using when you can't get them. This plugin returns the output of MediaPipe as is (if there are no bugs), so please note that you cannot get values that MediaPipe has not set.

tisaud commented 1 month ago

I just use Object Detection case in unity,but this plugin returns the output without DetectionId,TrackId or LabelId value.

tisaud commented 1 month ago

I would like to achieve the effect on the right side of the git image, recognize the effect of tracking, and return the id of the recognized object。 mediapipe

homuler commented 1 month ago

I think detection_id is not set by default, which is why it is always zero, so to track the object, you need to assign IDs to each detections by yourself. cf. https://github.com/google-ai-edge/mediapipe/blob/ebf54edc96dc30d48f39485b50eb61bcdd87043b/mediapipe/graphs/tracking/subgraphs/object_tracking_cpu.pbtxt#L9-L14

If you want to know how to configure such a CalculatorGraph, please ask the MediaPipe team.

tisaud commented 1 month ago

ok,thank you