Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
cb47bb2
feat: add CBIoUTracker (BoT-SORT with CMC disabled and BIoU association)
AlexBodner May 14, 2026
0bcbe35
refactor: simplify cbiou __init__.py to header-only
AlexBodner May 14, 2026
e1a6cf6
fix(pre_commit): 🎨 auto format pre-commit hooks
pre-commit-ci[bot] May 14, 2026
a4ab848
Remove plan file from version control
AlexBodner May 14, 2026
7ac4b47
updated CBioU with 2 buffer rates and docs
AlexBodner May 16, 2026
dccbbaf
fix(pre_commit): 🎨 auto format pre-commit hooks
pre-commit-ci[bot] May 16, 2026
86c42f8
preliminary numbers for cbiou
AlexBodner May 18, 2026
56c431c
Merge branch 'feat/core/cbiou-tracker' of https://github.com/roboflow…
AlexBodner May 18, 2026
8ea2d24
fix(pre_commit): 🎨 auto format pre-commit hooks
pre-commit-ci[bot] May 18, 2026
e492563
Merge branch 'develop' into feat/core/cbiou-tracker
Borda May 18, 2026
e4ab8c6
updated CBIoU numbers
AlexBodner May 19, 2026
3f75742
updated CBIoU numbers
AlexBodner May 19, 2026
7d40f2c
fix(pre_commit): 🎨 auto format pre-commit hooks
pre-commit-ci[bot] May 19, 2026
9094128
added expected cbiou results
AlexBodner May 19, 2026
e4d9dbb
Merge branch 'feat/core/cbiou-tracker' of https://github.com/roboflow…
AlexBodner May 19, 2026
baec230
small adjust in tests
AlexBodner May 19, 2026
9bc87a6
mypy fix
AlexBodner May 19, 2026
f55b1c5
fix(pre_commit): 🎨 auto format pre-commit hooks
pre-commit-ci[bot] May 19, 2026
cd33617
docs fix
AlexBodner May 19, 2026
eb92a34
Merge branch 'feat/core/cbiou-tracker' of https://github.com/roboflow…
AlexBodner May 19, 2026
ec23482
handling default confidence with utility
AlexBodner May 19, 2026
36deef2
fix(pre_commit): 🎨 auto format pre-commit hooks
pre-commit-ci[bot] May 19, 2026
6bb345c
Merge branch 'develop' into feat/core/cbiou-tracker
Borda May 20, 2026
220391f
Merge branch 'develop' into feat/core/cbiou-tracker
Borda May 20, 2026
aaa4432
Update docs/trackers/cbiou.md
AlexBodner May 20, 2026
91865b9
fix(pre_commit): 🎨 auto format pre-commit hooks
pre-commit-ci[bot] May 20, 2026
fc66939
fixed tests pointed out by Tomasz which were modified in PR #415 but …
AlexBodner May 20, 2026
7b45bb6
Merge branch 'feat/core/cbiou-tracker' of https://github.com/roboflow…
AlexBodner May 20, 2026
31668b4
applied some review comments to CBIoU md doc
AlexBodner May 21, 2026
a988af0
fix(pre_commit): 🎨 auto format pre-commit hooks
pre-commit-ci[bot] May 21, 2026
f1d9c6a
adjusted some docs to be less strict about comparing to paper
AlexBodner May 22, 2026
1e598ae
Merge branch 'feat/core/cbiou-tracker' of https://github.com/roboflow…
AlexBodner May 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
193 changes: 193 additions & 0 deletions docs/trackers/cbiou.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
---
title: C-BIoU — Cascaded-Buffered IoU Tracker | Trackers
comments: true
description: C-BIoU improves association under fast or irregualar motion by matching with Buffered IoU instead of plain IoU, using a ByteTrack-style pipeline.
---

# C-BIoU (Cascaded-Buffered IoU)

## What is C-BIoU?

C-BIoU builds on the same tracking pipeline as [ByteTrack](bytetrack.md) but replaces plain IoU with **Buffered IoU (BIoU)**, expanding boxes before overlap is computed so tracks and detections can still match when motion of the object is fast or boxes barely align. It runs two association passes with a small buffer first and a larger buffer second (`buffer_ratio_first` and `buffer_ratio_second`), so only bounding boxes are required. C-BIoU is a strong fit for sports and dance footage where objects move fast and change direction.

## How does C-BIoU compare to other trackers?

For comparisons with other trackers, plus default and tuned parameters, see the [tracker comparison](comparison.md) page.

| Dataset | HOTA | IDF1 | MOTA |
| :--------: | :--: | :--: | :--: |
| MOT17 | 63.0 | 79.1 | 77.4 |
| SportsMOT | 73.1 | 72.6 | 96.7 |
| SoccerNet | 82.6 | 76.6 | 97.0 |
| DanceTrack | 53.8 | 53.8 | 90.1 |

## How does C-BIoU work?

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?


**Second association (b2).** Remaining *tracked* tracks (not lost) are matched to low-confidence detections using BIoU with `buffer_ratio_second` (paper **b2**, large buffer). In this implementation, this larger buffer corresponds to ByteTrack's recovery stage for unmatched tracks and low-confidence detections.

**Unconfirmed association (b1).** Leftover high-confidence detections are matched to unconfirmed tracks using the same buffer as pass 1. Unmatched unconfirmed tracks are removed. This step is inherited from ByteTrack lifecycle logic, not the paper's two-buffer cascade.

**Track lifecycle.** New tracks are initiated and confirmed with a conservative policy (`minimum_consecutive_frames`) to reduce one-frame false positives. Existing tracks that remain unmatched longer than `lost_track_buffer` are removed.

## Key Parameters

| Parameter | Purpose | Tuning guidance |
| ----------------------------------------- | --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `lost_track_buffer` | Number of frames to keep an unmatched track alive before deletion. | Higher value tolerates longer occlusions but risks false re-association. Use range (10, 30) for most scenes; up to 60 for very long occlusions. |
| `track_activation_threshold` | Minimum detection confidence required to start a new track. | Higher value reduces noisy track creation; lower value retains harder objects. 0.5-0.9 typical depending on detector quality. This does not control low-confidence association, which still discards detections at a fixed `0.1` confidence floor. |
| `minimum_consecutive_frames` | Number of consecutive matches required before confirming a new track. | 1 for immediate activation; 2-3 improves robustness against flicker and false positives. |
| `minimum_iou_threshold_first_assoc` | Minimum fused BIoU similarity for the first association pass. | Lower value helps maintain matches under fast motion; higher value is stricter. |
| `minimum_iou_threshold_second_assoc` | Minimum BIoU similarity for the second association pass. | Usually set to a lower value than the first-pass threshold to recover weak detections without over-matching. |
| `minimum_iou_threshold_unconfirmed_assoc` | Minimum fused BIoU similarity when associating unconfirmed tracks. | Higher value makes tentative tracks harder to confirm spuriously; lower value helps short-lived or noisy objects survive. |
| `high_conf_det_threshold` | Confidence split between stage-1 and stage-2 detections. | 0.5-0.7 common. Higher value shifts more detections to recovery stage; lower value gives stage-1 broader coverage. |
| `buffer_ratio_first` | Paper **b1**, small BIoU buffer for the first association pass. | Typical range 0.1-0.7. Should be **less than** `buffer_ratio_second`. |
| `buffer_ratio_second` | Paper **b2**, large BIoU buffer for the second association pass. | Typical range 0.2-1.0. Should be **greater than** `buffer_ratio_first`. |

!!! warning "Buffer ordering (b1 < b2)"

Always set `buffer_ratio_first` < `buffer_ratio_second`. The cascaded matcher applies the **smaller** buffer first, then the **larger** buffer only on pairs that remain unmatched. Reversing the order (b1 ≥ b2) is not consistent with the paper and usually hurts performance.

!!! warning "Frame input is ignored by C-BIoU"

`CBIoUTracker.update()` accepts `frame` for API consistency with other trackers, but C-BIoU does not use image/frame pixels.
If you pass `frame` with a non-`None` value, the tracker emits a `UserWarning` and ignores it.

## Run on video, webcam, or RTSP stream

These examples use `opencv-python` for decoding and display. Replace `<SOURCE_VIDEO_PATH>`, `<WEBCAM_INDEX>`, and `<RTSP_STREAM_URL>` with your inputs. `<WEBCAM_INDEX>` is usually 0 for the default camera.

=== "Video"

```python
import cv2
import supervision as sv
from rfdetr import RFDETRMedium
from trackers import CBIoUTracker

tracker = CBIoUTracker()
model = RFDETRMedium()

box_annotator = sv.BoxAnnotator()
label_annotator = sv.LabelAnnotator()

video_capture = cv2.VideoCapture("<SOURCE_VIDEO_PATH>")
if not video_capture.isOpened():
raise RuntimeError("Failed to open video source")

while True:
success, frame_bgr = video_capture.read()
if not success:
break

frame_rgb = cv2.cvtColor(frame_bgr, cv2.COLOR_BGR2RGB)
detections = model.predict(frame_rgb)
detections = tracker.update(detections)

annotated_frame = box_annotator.annotate(frame_bgr, detections)
annotated_frame = label_annotator.annotate(
annotated_frame,
detections,
labels=detections.tracker_id,
)

cv2.imshow("RF-DETR + C-BIoU", annotated_frame)
if cv2.waitKey(1) & 0xFF == ord("q"):
break

video_capture.release()
cv2.destroyAllWindows()
```

=== "Webcam"

```python
import cv2
import supervision as sv
from rfdetr import RFDETRMedium
from trackers import CBIoUTracker

tracker = CBIoUTracker()
model = RFDETRMedium()

box_annotator = sv.BoxAnnotator()
label_annotator = sv.LabelAnnotator()

video_capture = cv2.VideoCapture("<WEBCAM_INDEX>")
if not video_capture.isOpened():
raise RuntimeError("Failed to open webcam")

while True:
success, frame_bgr = video_capture.read()
if not success:
break

frame_rgb = cv2.cvtColor(frame_bgr, cv2.COLOR_BGR2RGB)
detections = model.predict(frame_rgb)
detections = tracker.update(detections)

annotated_frame = box_annotator.annotate(frame_bgr, detections)
annotated_frame = label_annotator.annotate(
annotated_frame,
detections,
labels=detections.tracker_id,
)

cv2.imshow("RF-DETR + C-BIoU", annotated_frame)
if cv2.waitKey(1) & 0xFF == ord("q"):
break

video_capture.release()
cv2.destroyAllWindows()
```

=== "RTSP"

```python
import cv2
import supervision as sv
from rfdetr import RFDETRMedium
from trackers import CBIoUTracker

tracker = CBIoUTracker()
model = RFDETRMedium()

box_annotator = sv.BoxAnnotator()
label_annotator = sv.LabelAnnotator()

video_capture = cv2.VideoCapture("<RTSP_STREAM_URL>")
if not video_capture.isOpened():
raise RuntimeError("Failed to open RTSP stream")

while True:
success, frame_bgr = video_capture.read()
if not success:
break

frame_rgb = cv2.cvtColor(frame_bgr, cv2.COLOR_BGR2RGB)
detections = model.predict(frame_rgb)
detections = tracker.update(detections)

annotated_frame = box_annotator.annotate(frame_bgr, detections)
annotated_frame = label_annotator.annotate(
annotated_frame,
detections,
labels=detections.tracker_id,
)

cv2.imshow("RF-DETR + C-BIoU", annotated_frame)
if cv2.waitKey(1) & 0xFF == ord("q"):
break

video_capture.release()
cv2.destroyAllWindows()
```

For BIoU mathematics and using `BIoU(buffer_ratio=...)` on other trackers, see [IoU variants](../learn/iou.md#biou). To tune hyperparameters with Optuna, see [Hyperparameter tuning](../learn/tune.md).

## Reference

Yang, F., Odashima, S., Masui, S., and Jiang, S. (2023). Hard To Track Objects with Irregular Motions and Similar Appearances? Make It Easier by Buffering the Matching Space. WACV 2023. [arXiv:2211.14317](https://arxiv.org/abs/2211.14317)
87 changes: 72 additions & 15 deletions docs/trackers/comparison.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: SORT vs ByteTrack vs OC-SORT vs BoT-SORT — MOT Benchmark Comparison | Trackers
description: Side-by-side benchmark comparison of SORT, ByteTrack, OC-SORT, and BoT-SORT on MOT17, MOT20, DanceTrack, and SportsMOT — HOTA, IDF1, MOTA scores with default and tuned parameters.
title: SORT vs ByteTrack vs OC-SORT vs BoT-SORT vs C-BIoU — MOT Benchmark Comparison | Trackers
description: Side-by-side benchmark comparison of SORT, ByteTrack, OC-SORT, BoT-SORT, and C-BIoU on MOT17, DanceTrack, SportsMOT, and SoccerNet — HOTA, IDF1, MOTA with default and tuned parameters.
---

# Tracker Comparison

This page shows head-to-head performance of SORT, ByteTrack, OC-SORT, and BoT-SORT on standard MOT benchmarks. Results are shown with default parameters and with parameter-tuned configurations found via grid search.
This page shows head-to-head performance of SORT, ByteTrack, OC-SORT, BoT-SORT, and C-BIoU on standard MOT benchmarks. Results are shown with default parameters and with parameter-tuned configurations found via grid search.

!!! info "Benchmark version"

Expand Down Expand Up @@ -38,7 +38,8 @@ Pedestrian tracking with crowded scenes and frequent occlusions. Strongly tests
| SORT | 58.4 | 69.9 | 67.2 |
| ByteTrack | 60.1 | 73.2 | 74.1 |
| OC-SORT | 61.9 | 76.4 | 76.0 |
| BoT-SORT | **63.7** | **78.7** | **79.2** |
| BoT-SORT | **63.7** | 78.7 | **79.2** |
| C-BIoU | 63.0 | **79.1** | 77.4 |

=== "Tuned"

Expand All @@ -49,7 +50,8 @@ Pedestrian tracking with crowded scenes and frequent occlusions. Strongly tests
| SORT | 60.4 | 72.5 | 75.8 |
| ByteTrack | 60.5 | 72.7 | 76.1 |
| OC-SORT | 62.0 | 76.5 | 77.3 |
| BoT-SORT | **63.8** | **78.7** | **79.4** |
| BoT-SORT | **63.8** | 78.7 | **79.4** |
| C-BIoU | 63.0 | **79.1** | 77.4 |

Tuned configuration for each tracker.

Expand Down Expand Up @@ -85,6 +87,18 @@ Pedestrian tracking with crowded scenes and frequent occlusions. Strongly tests
track_activation_threshold: 0.6
enable_cmc: true
cmc_method: sparseOptFlow

C-BIoU:
lost_track_buffer: 30
minimum_consecutive_frames: 2
minimum_iou_threshold_first_assoc: 0.2
minimum_iou_threshold_second_assoc: 0.5
minimum_iou_threshold_unconfirmed_assoc: 0.3
high_conf_det_threshold: 0.6
track_activation_threshold: 0.7
buffer_ratio_first: 0.3
buffer_ratio_second: 0.5
enable_cmc: false
Comment thread
AlexBodner marked this conversation as resolved.
```

## [SportsMOT](https://arxiv.org/abs/2304.05170)
Expand All @@ -111,6 +125,7 @@ Sports broadcast tracking with fast motion, camera pans, and similar-looking tar
| ByteTrack | 73.0 | 72.5 | 96.4 |
| OC-SORT | 71.7 | 71.4 | 95.0 |
| BoT-SORT | **73.8** | **73.4** | **96.9** |
| C-BIoU | 73.1 | 72.6 | 96.7 |

=== "Tuned"

Expand All @@ -122,6 +137,7 @@ Sports broadcast tracking with fast motion, camera pans, and similar-looking tar
| ByteTrack | 73.3 | 73.5 | 95.9 |
| OC-SORT | 74.0 | **75.4** | 95.6 |
| BoT-SORT | **74.1** | 74.0 | **96.9** |
| C-BIoU | 73.1 | 72.6 | 96.7 |

Tuned configuration for each tracker.

Expand Down Expand Up @@ -157,6 +173,18 @@ Sports broadcast tracking with fast motion, camera pans, and similar-looking tar
track_activation_threshold: 0.8
enable_cmc: true
cmc_method: sparseOptFlow

C-BIoU:
lost_track_buffer: 30
minimum_consecutive_frames: 2
minimum_iou_threshold_first_assoc: 0.2
minimum_iou_threshold_second_assoc: 0.5
minimum_iou_threshold_unconfirmed_assoc: 0.3
high_conf_det_threshold: 0.6
track_activation_threshold: 0.7
buffer_ratio_first: 0.3
buffer_ratio_second: 0.5
enable_cmc: false
```

## [SoccerNet-tracking](https://arxiv.org/abs/2204.06918)
Expand Down Expand Up @@ -184,17 +212,19 @@ Long sequences with dense interactions and partial occlusions. Tests long-term I
| ByteTrack | 84.0 | 78.1 | **97.8** |
| OC-SORT | 78.4 | 72.6 | 94.1 |
| BoT-SORT | **84.5** | **79.3** | 96.6 |
| C-BIoU | 82.6 | 76.6 | 97.0 |

=== "Tuned"

Results after grid search over tracker parameters.

| Tracker | HOTA | IDF1 | MOTA |
| :-------: | :------: | :------: | :------: |
| SORT | 84.2 | 78.2 | **98.2** |
| ByteTrack | 84.0 | 78.1 | **98.2** |
| SORT | 84.2 | 78.2 | 98.2 |
| ByteTrack | 84.0 | 78.1 | 98.2 |
| OC-SORT | 82.9 | 77.9 | 96.8 |
| BoT-SORT | **85.0** | **79.7** | 97.2 |
| BoT-SORT | 85.0 | 79.7 | 97.2 |
| C-BIoU | **85.7** | **80.0** | **99.3** |

Tuned configuration for each tracker.

Expand Down Expand Up @@ -230,6 +260,17 @@ Long sequences with dense interactions and partial occlusions. Tests long-term I
track_activation_threshold: 0.7
enable_cmc: true
cmc_method: sparseOptFlow

C-BIoU:
lost_track_buffer: 43
minimum_consecutive_frames: 2
minimum_iou_threshold_first_assoc: 0.05
minimum_iou_threshold_second_assoc: 0.46
minimum_iou_threshold_unconfirmed_assoc: 0.27
high_conf_det_threshold: 0.40
track_activation_threshold: 0.48
buffer_ratio_first: 0.68
buffer_ratio_second: 0.50
Comment thread
AlexBodner marked this conversation as resolved.
```

## [DanceTrack](https://arxiv.org/abs/2111.14690)
Expand Down Expand Up @@ -261,8 +302,9 @@ Group dancing tracking with uniform appearance, diverse motions, and extreme art
| :-------: | :------: | :------: | :------: |
| SORT | 45.0 | 39.0 | 80.6 |
| ByteTrack | 50.2 | 49.9 | 86.2 |
| OC-SORT | **51.8** | **50.9** | **87.3** |
| OC-SORT | 51.8 | 50.9 | 87.3 |
| BoT-SORT | 50.5 | 49.2 | 85.1 |
| C-BIoU | **53.8** | **53.8** | **90.1** |

=== "Tuned"

Expand All @@ -271,9 +313,10 @@ Group dancing tracking with uniform appearance, diverse motions, and extreme art
| Tracker | HOTA | IDF1 | MOTA |
| :-------: | :------: | :------: | :------: |
| SORT | 50.6 | 49.6 | 84.3 |
| ByteTrack | **53.2** | **54.6** | 86.8 |
| OC-SORT | 52.0 | 51.8 | **87.2** |
| BoT-SORT | **53.5** | **54.0** | 86.5 |
| ByteTrack | 53.2 | 54.6 | 86.8 |
| OC-SORT | 52.0 | 51.8 | 87.2 |
| BoT-SORT | 53.5 | 54.0 | 86.5 |
| C-BIoU | **54.6** | **57.0** | **89.6** |

Tuned configuration for each tracker.

Expand Down Expand Up @@ -309,6 +352,17 @@ Group dancing tracking with uniform appearance, diverse motions, and extreme art
track_activation_threshold: 0.7
enable_cmc: true
cmc_method: sparseOptFlow

C-BIoU:
lost_track_buffer: 53
minimum_consecutive_frames: 2
minimum_iou_threshold_first_assoc: 0.11
minimum_iou_threshold_second_assoc: 0.57
minimum_iou_threshold_unconfirmed_assoc: 0.30
high_conf_det_threshold: 0.36
track_activation_threshold: 0.83
buffer_ratio_first: 0.23
buffer_ratio_second: 0.33
```

## Methodology
Expand All @@ -321,9 +375,10 @@ detector following the ByteTrack procedure). The source is noted per dataset abo

### Tuning

Best parameters per tracker and dataset were found via grid search, selecting the
configuration with the highest HOTA. Tuning and evaluation always use separate data
splits to reflect real-world usage:
Best parameters per tracker and dataset were found via grid search (SORT, ByteTrack,
OC-SORT, BoT-SORT) or Optuna (`n_trials=100`, objective HOTA, trial 0 = defaults for
C-BIoU), selecting the configuration with the highest HOTA on the tune split. Tuning and
evaluation always use separate data splits to reflect real-world usage:

- Train + validation + test: tune on validation, report on test.
- Train + validation: tune on train, report on validation.
Expand Down Expand Up @@ -354,6 +409,8 @@ association, which reduces ID switches on panning or handheld footage. Use BoT-S
broadcasts, drone video, or any scene where the camera moves frequently. The CMC overhead is
small relative to the detector, so the trade-off favors identity stability over raw speed.

**C-BIoU** targets irregular motion and similar appearances when you want buffered, cascaded geometric matching without camera motion compensation. It is strongest on SoccerNet and DanceTrack in these benchmarks, and reaches the highest IDF1 on MOT17 among the trackers listed here. Use C-BIoU when BoT-SORT-style association is a good fit but CMC is unavailable or harmful, or when plain IoU matching is too strict. See [C-BIoU](cbiou.md) for buffer scales **b1** and **b2**.
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.

"Similar appearances": the same remarks as for "similar appearances" above https://github.com/roboflow/trackers/pull/417/changes#r3273963540

Further, mind that if you write now "It is strongest on SoccerNet and DanceTrack in these benchmarks, and reaches the highest IDF1 on MOT17 among the trackers listed here.", you might need to update it later, when we add next trackers.

Either keep it in mind or adjust it (e.g. "demonstrates strong performance in these benchmarks", etc.)


## Metric Definitions

**HOTA** (Higher Order Tracking Accuracy) — the primary benchmark metric. HOTA decomposes
Expand Down
Loading
Loading