Skip to content

[McByte part 1] Add McByte tracker skeleton#388

Open
tstanczyk95 wants to merge 5 commits into
dev/mcbytefrom
feat/mcbyte-core-skeleton
Open

[McByte part 1] Add McByte tracker skeleton#388
tstanczyk95 wants to merge 5 commits into
dev/mcbytefrom
feat/mcbyte-core-skeleton

Conversation

@tstanczyk95
Copy link
Copy Markdown
Collaborator

What does this PR do?

Create a skeleton for new tracker, McByte - primarily derived from BoT-SORT, #386.
No mask functionality yet (SAM, Cutie). It serves as the base for the next PRs to build incrementally on top of it.

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:
Import the tracker. Run it (frame setting and calling its update function) on 5 dummy frames.

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)

@tstanczyk95 tstanczyk95 requested a review from SkalskiP as a code owner May 1, 2026 10:57
@tstanczyk95 tstanczyk95 requested review from AlexBodner and Borda and removed request for AlexBodner May 1, 2026 10:57
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.

is this the same as in BotSORT? if yes we should think of making it one separate reusable util.

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.

@AlexBodner Yes yes, for the current moment, the CMC in McByte it is exactly the same as the one in BoT-SORT, since this PR is just the very first skeleton.

I am planning to indeed extract the CMC to make it a common util for the trackers, but as I saw, there are still some changes going on with the BoT-SORT PR (from which I derived this branch). I thought about keeping it simple for now and adjust later, in the next PRs, to reduce merge conflicts, avoid the review noise, etc.

Copy link
Copy Markdown
Collaborator Author

@tstanczyk95 tstanczyk95 May 14, 2026

Choose a reason for hiding this comment

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

Adjusted, using the reusable util from this, already merged, #414.

In general, whole the whole code here adjusted with the released BoT-SORT.

@tstanczyk95 tstanczyk95 self-assigned this May 6, 2026
@tstanczyk95 tstanczyk95 force-pushed the feat/mcbyte-core-skeleton branch from e4e9b48 to 7fc1af1 Compare May 14, 2026 23:46
@tstanczyk95 tstanczyk95 changed the title Add McByte tracker skeleton [McByte part 1] Add McByte tracker skeleton May 15, 2026
@tstanczyk95 tstanczyk95 requested a review from AlexBodner May 15, 2026 02:07
@Borda Borda added the enhancement New feature or request label May 15, 2026
@Borda Borda requested a review from Copilot May 15, 2026 07:02
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 an initial “McByte” tracker implementation under trackers.core.mcbyte, largely mirroring the existing BoT-SORT-style pipeline (predict → optional CMC → high/low confidence association → spawn → prune), plus a basic smoke test to ensure the tracker can run a short CMC-enabled sequence.

Changes:

  • Introduces McByteTracker with ByteTrack/BoT-SORT-like two-stage association and optional CMC integration.
  • Adds McByteTracklet with scale-aware KF noise tuning, bbox clamping, and CMC application support.
  • Adds minimal unit test that instantiates the tracker and runs several updates with sparseOptFlow CMC enabled.

Reviewed changes

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

Show a summary per file
File Description
tests/core/test_mcbyte_tracker.py Adds a basic smoke test for McByte + CMC-enabled updates.
src/trackers/core/mcbyte/utils.py Adds tracklet pruning helper and IoU-score fusion helper.
src/trackers/core/mcbyte/tracklet.py Implements McByte tracklet state/KF behavior, including scale-aware noise + clamping + CMC hook.
src/trackers/core/mcbyte/tracker.py Implements McByte tracker skeleton (prediction, association stages, spawning, pruning, reset).
src/trackers/core/mcbyte/init.py Exposes McByteTracker from the mcbyte subpackage.

Comment on lines +26 to +28
class McByteTracker(BaseTracker):
tracker_id = "mcbyte"

Copy link
Copy Markdown
Collaborator Author

@tstanczyk95 tstanczyk95 May 15, 2026

Choose a reason for hiding this comment

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

Complete class docstring will be provided when McByte development is finished. Now we are in the phase of building it part by part and adding next features.

The dev/mcbyte-clean branch will be opened and then merged with develop upon completion.

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.

Current version docstring provided in 51874ea.

# ------------------------------------------------------------------------
from .tracker import McByteTracker

__all__ = ["McByteTracker"]
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.

Remark as above with the separate branch to be merged upon the completion at the end.

Comment thread tests/core/test_mcbyte_tracker.py Outdated
# Licensed under the Apache License, Version 2.0 [see LICENSE for details]
# ------------------------------------------------------------------------

# tests/core/mcbyte/test_mcbyte_tracker.py
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.

Addressed in 706a6f8.

Comment thread tests/core/test_mcbyte_tracker.py Outdated
Comment on lines +29 to +30
def test_mcbyte_instantiates_sets_frame_and_updates_with_sparse_opt_flow_cmc() -> None:
"""McByteTracker can run one basic CMC-enabled tracking sequence."""
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.

Applied in 706a6f8.

@tstanczyk95 tstanczyk95 changed the base branch from develop to dev/mcbyte-clean May 18, 2026 15:55
@tstanczyk95 tstanczyk95 changed the base branch from dev/mcbyte-clean to develop May 18, 2026 16:03
@tstanczyk95 tstanczyk95 changed the base branch from develop to dev/mcbyte May 19, 2026 12:42


class McByteTracker(BaseTracker):
tracker_id = "mcbyte"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why this is needed, seem like you couls simply use self.__class__.__name__


class McByteTracker(BaseTracker):
tracker_id = "mcbyte"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maximum_frames_without_update: int
minimum_consecutive_frames: int
...

self.enable_cmc = enable_cmc
self.cmc = CMC(CMCConfig(method=cmc_method, downscale=cmc_downscale)) if enable_cmc else None

def update(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it is getting quite long, can we split it in a few private methods?

self,
initial_bbox: np.ndarray,
state_estimator_class: type[BaseStateEstimator] = XCYCWHStateEstimator,
) -> None:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lets add dcostring with args

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