[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__
There was a problem hiding this comment.
This is done in consistency with all the other trackers, e.g. with BoT-SORT: https://github.com/roboflow/trackers/blob/develop/src/trackers/core/botsort/tracker.py#L95
search_space will be considered at later stages.
There was a problem hiding this comment.
ok so maybe worth to revisit the patter with all :)
|
|
||
| class McByteTracker(BaseTracker): | ||
| tracker_id = "mcbyte" | ||
|
|
There was a problem hiding this comment.
maximum_frames_without_update: int
minimum_consecutive_frames: int
...
There was a problem hiding this comment.
Could you please clarify on this one?
If you meant class docstring for the McByteTracker class, it has been addressed in the PR from Part 2: #418
https://github.com/roboflow/trackers/pull/418/changes#diff-ac854e39fe30bd0d79d2efce4291889e0415197f4f1ebb48f89c79cab6e21a81R33
| 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?
There was a problem hiding this comment.
It is in consistency with the BoT-SORT tracker, done the same way:
https://github.com/roboflow/trackers/blob/develop/src/trackers/core/botsort/tracker.py#L148
There was a problem hiding this comment.
my perspective was to have update composed from a few private methods so the code becomes easier to follow and easier to test as partucular methods can have simple unittests
There was a problem hiding this comment.
For now the update() method is also the same style as the other trackers. And exactly the same as BoT-SORT. But if it becomes longer and/or more complex later with the next McByte dev, it might be indeed good to split it into a few private methods!
| self, | ||
| initial_bbox: np.ndarray, | ||
| state_estimator_class: type[BaseStateEstimator] = XCYCWHStateEstimator, | ||
| ) -> None: |
There was a problem hiding this comment.
It is done with the consistency with other trackers, e.g BoT-SORT:
https://github.com/roboflow/trackers/blob/develop/src/trackers/core/botsort/tracklet.py#L47
None of the trackers currently has a docstring for the init method.
All of them, including McByte have the class docstring, though:
https://github.com/roboflow/trackers/blob/develop/src/trackers/core/botsort/tracklet.py#L23
https://github.com/roboflow/trackers/pull/388/changes/BASE..970d17cb733d1220f03abd3cfc04342523767bde#diff-4fd50d576fa05b618ccbe713e9bceaf203aa8c6fe4139b4a080f818de957caaeR23
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