refactor: deprecate ByteTrack class in favor of ByteTrackTracker#2215
Merged
refactor: deprecate ByteTrack class in favor of ByteTrackTracker#2215
ByteTrack class in favor of ByteTrackTracker#2215Conversation
- Mark `ByteTrack` as deprecated using `@deprecated_class`. - Add deprecation details and alternatives in the class docstring. - Update version annotations for deprecation (`deprecated_in="0.28.0"`, `remove_in="0.30.0"`).
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors class deprecation handling to use deprecated_class (instead of deprecated) and removes now-unnecessary workaround code related to deprecated-class wrapping behavior, while also updating the pydeprecate dependency requirement to support the new decorator.
Changes:
- Switched
MeanAveragePrecisionandByteTrackto@deprecated_class(...)for class deprecations. - Removed the manual staticmethod rebinding workaround previously needed for deprecated classes on Python 3.9.
- Updated
pydeprecateversion constraint inpyproject.toml.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/supervision/tracker/byte_tracker/core.py |
Deprecates ByteTrack via deprecated_class and adds a migration note in the docstring. |
src/supervision/metrics/detection.py |
Uses deprecated_class for MeanAveragePrecision and removes the deprecated-wrapper staticmethod workaround. |
pyproject.toml |
Bumps pydeprecate dependency range to support deprecated_class. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2215 +/- ##
=======================================
Coverage 77% 77%
=======================================
Files 66 66
Lines 8189 8189
=======================================
Hits 6303 6303
Misses 1886 1886 🚀 New features to boost your workflow:
|
This was referenced Apr 16, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates deprecation handling in the codebase to use the new
deprecated_classdecorator and removes workarounds related to the previous deprecation implementation. Additionally, it updates thepydeprecatedependency to a newer compatible version.Deprecation handling improvements:
@deprecateddecorator with@deprecated_classfor class deprecations in bothMeanAveragePrecisionandByteTrack, ensuring more accurate deprecation warnings and future compatibility. [1] [2]Dependency updates:
pydeprecatedependency version inpyproject.tomlto>=0.7,<0.8to support the new deprecation features.Code consistency:
deprecated_classinstead ofdeprecatedwhere appropriate. [1] [2]Deprecation notice improvements:
ByteTrackclass docstring, guiding users to migrate toByteTrackTrackerfrom thetrackerspackage.closes #2202
closes #1985
closes #1367
closes #1355
closes #1320
closes #594
closes #2206
closes #2009
closes #1404
closes #782
closes #2193
closes #1381
closes #1318