ObjectTracker: expose tracking paramters; add force remove functionality#1109
Merged
SzabolcsGergely merged 5 commits intodevelopfrom May 9, 2025
Merged
ObjectTracker: expose tracking paramters; add force remove functionality#1109SzabolcsGergely merged 5 commits intodevelopfrom
SzabolcsGergely merged 5 commits intodevelopfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the object tracking functionality by adding new properties and setter methods to better configure tracking behavior.
- Introduces new bindings for occlusion ratio threshold, tracklet max lifespan, and tracklet birth threshold.
- Adds a new object tracker configuration binding and updates the Python example to use a tracker configuration input node.
Reviewed Changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/pipeline/node/ObjectTrackerBindings.cpp | Adds new property and setter bindings; however, there is a duplicate binding for "trackingPerClass". |
| src/pipeline/datatype/ObjectTrackerConfigBindings.cpp | Introduces bindings for the object tracker configuration. |
| src/DatatypeBindings.cpp | Registers the new object tracker configuration binding to the callstack. |
| examples/ObjectTracker/object_tracker.py | Updates the example pipeline to include tracker configuration parameters and handling. |
Files not reviewed (2)
- CMakeLists.txt: Language not supported
- depthai-core: Language not supported
| .def_readwrite("trackerIdAssignmentPolicy", &ObjectTrackerProperties::trackerIdAssignmentPolicy, DOC(dai, ObjectTrackerProperties, trackerIdAssignmentPolicy)) | ||
| .def_readwrite("trackingPerClass", &ObjectTrackerProperties::trackingPerClass, DOC(dai, ObjectTrackerProperties, trackingPerClass)) | ||
| .def_readwrite("occlusionRatioThreshold", &ObjectTrackerProperties::occlusionRatioThreshold, DOC(dai, ObjectTrackerProperties, occlusionRatioThreshold)) | ||
| .def_readwrite("trackingPerClass", &ObjectTrackerProperties::trackingPerClass, DOC(dai, ObjectTrackerProperties, trackingPerClass)) |
There was a problem hiding this comment.
Duplicate binding for 'trackingPerClass' detected. Please remove the duplicate line to avoid potential runtime issues or unexpected behavior.
Suggested change
| .def_readwrite("trackingPerClass", &ObjectTrackerProperties::trackingPerClass, DOC(dai, ObjectTrackerProperties, trackingPerClass)) |
moratom
approved these changes
May 7, 2025
| cv2.rectangle(frame, (x1, y1), (x2, y2), color, cv2.FONT_HERSHEY_SIMPLEX) | ||
|
|
||
| if t.status == dai.Tracklet.TrackingStatus.TRACKED: | ||
| latestTrackedIds.append(t.id) |
Collaborator
There was a problem hiding this comment.
Any specific reason to have that condition here?
The UX seems better without it to me, since I presume you often want to prematurely remove the LOST tracklets.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated object_tracker.py to reflect new functionality and API usage:
Purpose
Specification
None / not applicable
Dependencies & Potential Impact
None / not applicable
Deployment Plan
None / not applicable
Testing & Validation
None / not applicable