Skip to content

Feat/core/CBioU tracker#417

Open
AlexBodner wants to merge 4 commits into
developfrom
feat/core/cbiou-tracker
Open

Feat/core/CBioU tracker#417
AlexBodner wants to merge 4 commits into
developfrom
feat/core/cbiou-tracker

Conversation

@AlexBodner
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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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, (
Comment thread tests/core/shared_ids.py

# 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] —
Comment thread src/trackers/__init__.py
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
@AlexBodner AlexBodner changed the title Feat/core/cbiou tracker Feat/core/CBioU tracker May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants