[McByte part 1] Add McByte tracker skeleton#388
Conversation
There was a problem hiding this comment.
is this the same as in BotSORT? if yes we should think of making it one separate reusable util.
There was a problem hiding this comment.
@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.
There was a problem hiding this comment.
Adjusted, using the reusable util from this, already merged, #414.
In general, whole the whole code here adjusted with the released BoT-SORT.
e4e9b48 to
7fc1af1
Compare
There was a problem hiding this comment.
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
McByteTrackerwith ByteTrack/BoT-SORT-like two-stage association and optional CMC integration. - Adds
McByteTrackletwith scale-aware KF noise tuning, bbox clamping, and CMC application support. - Adds minimal unit test that instantiates the tracker and runs several updates with
sparseOptFlowCMC 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. |
| class McByteTracker(BaseTracker): | ||
| tracker_id = "mcbyte" | ||
|
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Current version docstring provided in 51874ea.
| # ------------------------------------------------------------------------ | ||
| from .tracker import McByteTracker | ||
|
|
||
| __all__ = ["McByteTracker"] |
There was a problem hiding this comment.
Remark as above with the separate branch to be merged upon the completion at the end.
| # Licensed under the Apache License, Version 2.0 [see LICENSE for details] | ||
| # ------------------------------------------------------------------------ | ||
|
|
||
| # tests/core/mcbyte/test_mcbyte_tracker.py |
| def test_mcbyte_instantiates_sets_frame_and_updates_with_sparse_opt_flow_cmc() -> None: | ||
| """McByteTracker can run one basic CMC-enabled tracking sequence.""" |
|
|
||
|
|
||
| class McByteTracker(BaseTracker): | ||
| tracker_id = "mcbyte" |
There was a problem hiding this comment.
why this is needed, seem like you couls simply use self.__class__.__name__
|
|
||
| class McByteTracker(BaseTracker): | ||
| tracker_id = "mcbyte" | ||
|
|
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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: |
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
Testing
Test details:
Import the tracker. Run it (frame setting and calling its update function) on 5 dummy frames.
Checklist