Skip to content

Feat/core/CBioU tracker#417

Merged
Borda merged 41 commits into
developfrom
feat/core/cbiou-tracker
Jun 9, 2026
Merged

Feat/core/CBioU tracker#417
Borda merged 41 commits into
developfrom
feat/core/cbiou-tracker

Conversation

@AlexBodner

@AlexBodner AlexBodner commented May 14, 2026

Copy link
Copy Markdown
Collaborator

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

  • New feature (non-breaking change that adds functionality)

Testing

  • I have tested this change locally
  • I have added/updated tests for this change

Test details:

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in hard-to-understand areas
  • My changes generate no new warnings or errors
  • I have updated the documentation accordingly (if applicable)

Additional Context

AlexBodner and others added 2 commits May 14, 2026 13:48
- 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>
@AlexBodner AlexBodner requested a review from SkalskiP as a code owner May 14, 2026 19:06
pre-commit-ci Bot and others added 2 commits May 14, 2026 19:06
Plans are working documents and should not be tracked in the repository.

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 CBIoUTracker implementation 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 thread tests/core/test_cbiou_tracker.py Outdated
Comment thread tests/core/shared_ids.py Outdated
Comment thread tests/core/test_cbiou_tracker.py Outdated
Comment thread src/trackers/core/cbiou/__init__.py
Comment thread tests/core/test_cbiou_tracker.py Outdated
Comment thread src/trackers/__init__.py
@AlexBodner AlexBodner changed the title Feat/core/cbiou tracker Feat/core/CBioU tracker May 15, 2026
@Borda

Borda commented May 18, 2026

Copy link
Copy Markdown
Member

Let's mark as resolved the comment which you already addressed, so we know what is left

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (2)

docs/trackers/comparison.md:187

  • The comparison page lists enable_cmc: false under the C-BIoU configuration, but CBIoUTracker.init does not accept an enable_cmc parameter (CMC is always disabled internally). Remove this key from the example config (or reword it as a note) to avoid suggesting an invalid constructor argument.
      high_conf_det_threshold: 0.6
      track_activation_threshold: 0.7
      buffer_ratio_first: 0.3
      buffer_ratio_second: 0.5
      enable_cmc: false

docs/trackers/comparison.md:367

  • The comparison page lists enable_cmc: false under the C-BIoU configuration, but CBIoUTracker.init does not accept an enable_cmc parameter (CMC is always disabled internally). Remove this key from the example config (or reword it as a note) to avoid suggesting an invalid constructor argument.
      high_conf_det_threshold: 0.36
      track_activation_threshold: 0.83
      buffer_ratio_first: 0.23
      buffer_ratio_second: 0.33
      enable_cmc: false

Comment thread src/trackers/core/cbiou/tracker.py
Comment thread src/trackers/core/cbiou/tracker.py
Comment thread tests/core/test_cbiou_tracker.py Outdated
Comment thread docs/trackers/comparison.md Outdated
Comment thread docs/trackers/comparison.md
Comment thread docs/trackers/cbiou.md Outdated
Borda
Borda previously approved these changes May 20, 2026
Comment thread docs/trackers/cbiou.md Outdated
Comment thread docs/trackers/cbiou.md Outdated
Comment thread docs/trackers/cbiou.md Outdated
Comment thread docs/trackers/cbiou.md Outdated

C-BIoU keeps the [ByteTrack](bytetrack.md)-style association pipeline used in [BoT-SORT](botsort.md) but replaces plain IoU with **cascaded Buffered IoU** at each association step.

**First association (b1).** High-confidence detections are matched to confirmed and lost tracks using BIoU with `buffer_ratio_first` (paper **b1**, small buffer). Costs are fused with detection confidence.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you say "paper b1" here, you might provide the link to the reference section below: ## Reference
Same for "paper b2" below.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have to provide the reference every time we mention it?

Comment thread docs/trackers/cbiou.md Outdated
Comment thread src/trackers/core/cbiou/tracker.py Outdated
self.iou_first = BIoU(buffer_ratio=buffer_ratio_first)
self.iou_second = BIoU(buffer_ratio=buffer_ratio_second)
self.buffer_ratio_first = buffer_ratio_first
self.buffer_ratio_second = buffer_ratio_second

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider some warning for the user if ultimately self.buffer_ratio_first becomes higher or equal to self.buffer_ratio_second?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont think so, it is just recommended by paper authors, but like you pointed over Slack, if it works better or the user sees fit using a higher threshold first should be fine

class TestCBIoUAssociationTolerance:
"""BIoU should associate near-miss detections that plain IoU would miss."""

def test_near_miss_associated_with_buffer(self) -> None:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice test to demonstrate, but it actually safe? And not too number/case-specific?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is very specific, but it tests what we want right? what seems off to you?

Comment thread tests/core/test_trackers.py
Comment thread tests/core/test_trackers.py
Borda and others added 2 commits May 20, 2026 18:52
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Borda
Borda previously approved these changes May 22, 2026
Borda and others added 8 commits June 9, 2026 16:25
[resolve R3] /review finding by foundry:perf-optimizer (report: .reports/review/2026-06-09T13-31-20Z/review-report.md):
- `import supervision as sv` was inside BIoU._compute() and IoU._compute() — called 2-3x per frame in the hot association path; moved to module top

---
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
[resolve #40/#41] @Copilot (gh):
- CBIoUTracker forces enable_cmc=False internally; key misleads users into thinking it is a valid config parameter
- Removed from MOT17/DanceTrack block (line 101) and SportsMOT block (line 187)

---
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
[resolve R1] /review finding by foundry:doc-scribe (report: .reports/review/2026-06-09T13-31-20Z/review-report.md):
- SoccerNet tuned config ships b1=0.68 > b2=0.50, contradicting the b1 < b2 warning in cbiou.md
- Added admonition callout explaining the empirical exception rather than removing the tuned result

---
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
[resolve R2] /review finding by foundry:sw-engineer (report: .reports/review/2026-06-09T13-31-20Z/review-report.md):
- Added class-level Note and updated update() Returns section to document that unmatched low-confidence detections appear with tracker_id=-1
- Added TestCBIoUUnmatchedLowConfidence.test_unmatched_low_conf_detection_has_minus_one_tracker_id exercising the undocumented path

---
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
[resolve #17] @tstanczyk95 (gh):
- 'paper b1' and 'paper b2' in the How it works section now link to ## Reference anchor

---
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
[resolve #23] @tstanczyk95 (gh):
- 'similar appearances' → 'fast or irregular motion' (more precise use-case framing)
- 'It is strongest on' → 'it leads on'; 'reaches the highest' → 'achieves the highest'
[resolve #25] @tstanczyk95 (gh): tracker.py:24 is the paper title — kept verbatim as citation

---
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
[resolve #26] @tstanczyk95 (gh): buffer_ratio_second bullet now names the track set ('remaining confirmed tracks') for clarity
[resolve S2] /review finding by foundry:doc-scribe (report: .reports/review/2026-06-09T13-31-20Z/review-report.md): added Example: section to class docstring (project convention)
[resolve S3] /review finding by foundry:doc-scribe (report: .reports/review/2026-06-09T13-31-20Z/review-report.md): added Raises: section documenting ValueError from BIoU.__init__ for negative buffer_ratio

---
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
[resolve S1] /review finding by foundry:doc-scribe (report: .reports/review/2026-06-09T13-31-20Z/review-report.md):
- 'irregualar' → 'irregular' in YAML description field

---
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
@Borda Borda merged commit 5b094d3 into develop Jun 9, 2026
29 of 30 checks passed
@Borda Borda deleted the feat/core/cbiou-tracker branch June 9, 2026 19:54
Borda added a commit to cdeil/trackers that referenced this pull request Jun 9, 2026
CBIoUTracker (added in roboflow#417) still called the removed BoTSORTTracklet.get_next_tracker_id()
classmethod at three sites in update() — breaking all 12 CI matrix runs with AttributeError
since PR roboflow#419 deleted that classmethod. Replace all three with self._allocate_tracker_id(),
which is already available via BoTSORTTracker -> BaseTracker inheritance.

---
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Borda added a commit that referenced this pull request Jun 23, 2026
- Stamp CHANGELOG [Unreleased] → [2.5.0] — 2026-06-22; add missing entries: CBIoUTracker (#417), py.typed, Tuner params (#427), HOTA eval fixes (#462, #466)
- Bump version 2.4.0 → 2.5.0 in pyproject.toml
- Add C-BIoU row to README algorithms table and intro text (MOT17=63.0, SportsMOT=73.1, SoccerNet=82.6, DanceTrack=56.7)

---

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants