Feat/core/CBioU tracker#417
Open
AlexBodner wants to merge 4 commits into
Open
Conversation
- New `CBIoUTracker` subclass of `BoTSORTTracker` registered as "cbiou" - CMC permanently disabled; `buffer_ratio` elevated as first-class param - `update()` emits UserWarning when frame is passed (CMC off) - `search_space` covers all tunable params + buffer_ratio [0.0, 0.5] - 13 dedicated tests in tests/core/test_cbiou_tracker.py - `IOC_TRACKER_IDS` in shared_ids.py excludes CBIoU from iou= injection test - Exported from top-level trackers package Co-authored-by: Cursor <cursoragent@cursor.com>
Plans are working documents and should not be tracked in the repository. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new CBIoU tracker as a BoT-SORT-derived tracker that disables CMC and uses Buffered IoU for association, then exposes it through the package API and shared tracker test coverage.
Changes:
- Adds
CBIoUTrackerimplementation and package entry point. - Exports CBIoU from
trackers. - Extends tracker registration/shared behavior tests and adds CBIoU-specific tests.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/trackers/core/cbiou/tracker.py |
Implements the CBIoU tracker wrapper around BoT-SORT with BIoU and CMC disabled. |
src/trackers/core/cbiou/__init__.py |
Adds the new CBIoU package. |
src/trackers/__init__.py |
Exposes CBIoUTracker from the top-level package. |
tests/core/shared_ids.py |
Adds cbiou to shared tracker IDs and separates IoU-configurable trackers. |
tests/core/test_trackers.py |
Excludes CBIoU from the configurable-IoU test. |
tests/core/test_registration.py |
Includes CBIoU in registration/search-space coverage. |
tests/core/test_cbiou_tracker.py |
Adds CBIoU-specific construction, warning, association, and search-space tests. |
Comment on lines
+146
to
+148
| botsort_frame1_track_id = next((t.tracker_id for t in botsort.tracks), None) | ||
| # Original BoTSORT track should be gone or unmatched | ||
| assert botsort_ids[0] != cbiou_frame1 or botsort_ids[0] == -1, ( |
|
|
||
| # Trackers that accept a user-supplied ``iou=`` constructor argument. | ||
| # CBIoU is intentionally excluded: it is opinionated and always uses BIoU. | ||
| IOC_TRACKER_IDS = [tid for tid in ALL_TRACKER_IDS if tid != "cbiou"] |
Comment on lines
+174
to
+177
| # Both should produce the same number of outputs | ||
| assert len(r_cbiou) == len(r_botsort), ( | ||
| f"CBIoU(buffer=0) and BoTSORT(no CMC) diverged: cbiou={len(r_cbiou)}, botsort={len(r_botsort)}" | ||
| ) |
| # Trackers | ||
| # Copyright (c) 2026 Roboflow. All Rights Reserved. | ||
| # Licensed under the Apache License, Version 2.0 [see LICENSE for details] | ||
| # ------------------------------------------------------------------------ |
| Box A: [0, 0, 100, 100] (100x100) | ||
| Box B: [110, 0, 210, 100] (gap of 10px = 10% of width) | ||
| With buffer_ratio=0.15 each side expands by 15px, so A becomes | ||
| [-15, -15, 115, 115] and B becomes [93.5, -15, 226.5, 115] — |
| from trackers.annotators.trace import MotionAwareTraceAnnotator | ||
| from trackers.core.botsort.tracker import BoTSORTTracker | ||
| from trackers.core.bytetrack.tracker import ByteTrackTracker | ||
| from trackers.core.cbiou.tracker import CBIoUTracker |
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.
What does this PR do?
Adding CBIoU tracker as wrapper of IoU variants BIoU and BoTsort without cmc (which would be original bytetrack).
Still missing the metrics
Type of Change
Testing
Test details:
Checklist
Additional Context