Repository navigation
chore(deprecation): remove scheduled for removal in 0.31.0 [rebase&merge] - #2582
Conversation
`sv.ByteTrack` was deprecated in 0.28.0 with removal planned for 0.31.0 in favour of `ByteTrackTracker` from the external `trackers` package. Removes the whole `supervision.tracker` package (only ever held byte_tracker), its tests, docs page, mkdocs nav entry, and the lazy `__getattr__`/TYPE_CHECKING plumbing in `supervision/__init__.py` that resolved it. --- Co-Authored-By: Claude Sonnet 5 <[email protected]>
…r removal in 0.31.0 The `supervision.keypoint` module was deprecated in 0.27.0 as a pure re-export shim redirecting to `supervision.key_points`, with removal planned for 0.31.0. Removes the shim package; import from `supervision.key_points` instead. --- Co-Authored-By: Claude Sonnet 5 <[email protected]>
…_annotation/processing wrappers All four were deprecated in 0.27.0 with removal planned for 0.31.0: `create_tiles` and `overlay_image` in `supervision.utils.image`, and `ensure_cv2_image_for_annotation`, `ensure_pil_image_for_annotation`, `ensure_cv2_image_for_processing` in `supervision.utils.conversion`. Removes the public wrappers and, for `create_tiles`, its now-unreachable private helper cluster (`_negotiate_tiles_format`, `_generate_tiles`, `_draw_texts`, etc. — used by nothing else). The private implementations backing the other three (`_overlay_image`, `ensure_cv2_image_for_class_method`, `ensure_pil_image_for_class_method`, `ensure_cv2_image_for_standalone_function`) are unaffected and remain in internal use. --- Co-Authored-By: Claude Sonnet 5 <[email protected]>
…_keypoints_fields Both were deprecated in 0.27.0 with removal planned for 0.31.0, superseded by the private `_validate_keypoint_confidence`/`_validate_keypoints_fields` and their 0.29.0-deprecated replacements `validate_key_point_confidence`/ `validate_key_points_fields` (removal 0.32.0, unaffected). --- Co-Authored-By: Claude Sonnet 5 <[email protected]>
The `normalized_xyxy` parameter of `sv.denormalize_boxes` was deprecated in 0.27.0 in favour of the `xyxy` positional argument, with removal planned for 0.31.0. Removes the parameter and the `@deprecated(target=TargetMode.ARGS_REMAP)` decorator; the function itself is unchanged. --- Co-Authored-By: Claude Sonnet 5 <[email protected]>
…dataset.utils Both were deprecated in 0.28.0 as re-exports of the functions that moved to `supervision.detection.utils.converters`, with removal from `supervision.dataset.utils` planned for 0.31.0. Import from `supervision.detection.utils.converters` (or top-level `sv.mask_to_rle`/ `sv.rle_to_mask`) instead. --- Co-Authored-By: Claude Sonnet 5 <[email protected]>
`sv.LMM` was deprecated in 0.27.0 and `Detections.from_lmm` in 0.26.0, both scheduled for removal in 0.31.0 in favour of `sv.VLM` and `Detections.from_vlm`. Removes the enum, the classmethod, and their test coverage; `VLM`/`from_vlm` are unaffected. --- Co-Authored-By: Claude Sonnet 5 <[email protected]>
The pycocotools-inconsistent `MeanAveragePrecision` in `supervision.metrics.detection` was deprecated in 0.27.0 (missing from docs/deprecated.md — doc drift, code decorator says removal in 0.31.0) in favour of `supervision.metrics.mean_average_precision.MeanAveragePrecision`, which matches pycocotools and is exposed as `sv.metrics.MeanAveragePrecision`. Removes the old class and its now-dead imports (`TargetMode`, `deprecated_class`, `_greedy_match`); `ConfusionMatrix` in the same module is unaffected. --- Co-Authored-By: Claude Sonnet 5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2582 +/- ##
========================================
+ Coverage 90% 91% +1%
========================================
Files 87 78 -9
Lines 12073 11359 -714
========================================
- Hits 10885 10363 -522
+ Misses 1188 996 -192 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
Numerous examples, API docstrings, links, and machine-readable documentation still direct users to the removed ByteTrack API.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Removes APIs scheduled for deletion in Supervision 0.31.0 and documents their replacements.
Changes:
- Removes legacy ByteTrack, keypoint, VLM, image, validation, and metric APIs.
- Updates affected tests and public exports.
- Adds removal and migration documentation, though several examples and metadata remain outdated.
Quality: Code 4/5 · Testing 4/5 · Documentation 2/5
Risk: 4/5 — broad breaking API removal with incomplete downstream migration.
File summaries
| File | Description |
|---|---|
tests/utils/test_image.py |
Tests internal overlay implementation. |
tests/tracker/test_byte_tracker.py |
Removes built-in tracker tests. |
tests/test_validate_deprecations.py |
Removes expired deprecation tests. |
tests/test_public_api.py |
Removes ByteTrack lazy-export handling. |
tests/metrics/test_detection.py |
Removes legacy mAP tests. |
tests/detection/test_vlm.py |
Removes legacy LMM test. |
tests/detection/test_from_adapters.py |
Removes from_lmm tests. |
tests/annotators/test_core.py |
Generalizes warning assertions. |
src/supervision/validators/__init__.py |
Removes legacy keypoint validators. |
src/supervision/utils/image.py |
Removes public overlay and tiling utilities. |
src/supervision/utils/conversion.py |
Removes deprecated conversion decorators. |
src/supervision/tracker/byte_tracker/utils.py |
Removes tracker ID utilities. |
src/supervision/tracker/byte_tracker/single_object_track.py |
Removes track state implementation. |
src/supervision/tracker/byte_tracker/matching.py |
Removes tracker matching helpers. |
src/supervision/tracker/byte_tracker/kalman_filter.py |
Removes tracker Kalman filter. |
src/supervision/tracker/byte_tracker/core.py |
Removes built-in ByteTrack. |
src/supervision/tracker/__init__.py |
Removes tracker compatibility export. |
src/supervision/metrics/detection.py |
Removes legacy mAP implementation. |
src/supervision/keypoint/core.py |
Removes deprecated module alias. |
src/supervision/keypoint/annotators.py |
Removes deprecated annotator aliases. |
src/supervision/keypoint/__init__.py |
Removes deprecated package exports. |
src/supervision/detection/vlm.py |
Removes the LMM enum. |
src/supervision/detection/utils/boxes.py |
Removes renamed argument compatibility. |
src/supervision/detection/core.py |
Removes Detections.from_lmm. |
src/supervision/dataset/utils.py |
Removes legacy RLE import paths. |
src/supervision/__init__.py |
Removes deprecated public exports. |
mkdocs.yml |
Removes tracker reference navigation. |
docs/utils/conversion.md |
Removes deleted decorator references. |
docs/trackers.md |
Removes ByteTrack API page. |
docs/how_to/track_objects.md |
Adds tracker removal notices. |
docs/how_to/count_in_zone.md |
Updates tracker migration guidance. |
docs/faq.md |
Updates tracking recommendation. |
docs/detection/utils/vlms.md |
Removes LMM documentation. |
docs/detection/metrics.md |
Removes legacy mAP reference. |
docs/detection/annotators.md |
Adds tracker removal warning. |
docs/deprecated.md |
Records 0.31.0 removals. |
docs/changelog.md |
Adds removal changelog entry. |
Review details
- Files reviewed: 37/39 changed files
- Comments generated: 5
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…erlay_image docstring Follow-up to the overlay_image removal: _overlay_image's docstring still explained itself relative to the now-deleted public wrapper. --- Co-Authored-By: Claude Sonnet 5 <[email protected]>
8304bfb to
e5c750d
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Multiple moderate migration findings can cause incorrect tracking, smoothing, speed, timer, and zone results.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (24)
docs/changelog.md:10
- Removing
docs/trackers.mdleaves the existing unversioned link atdocs/changelog.md:419pointing to/latest/trackers/, which will no longer exist after this removal. Update that historical entry to a stable versioned page or the external tracker documentation.
- Removed, as scheduled for `supervision-0.31.0`: `sv.ByteTrack` (use `ByteTrackTracker` from the `trackers` package instead); the `supervision.keypoint` module (use `supervision.key_points`); `create_tiles` and `overlay_image` in `supervision.utils.image`; `ensure_cv2_image_for_annotation`, `ensure_pil_image_for_annotation`, and `ensure_cv2_image_for_processing` in `supervision.utils.conversion`; `validate_keypoint_confidence` and `validate_keypoints_fields` in `supervision.validators`; the `normalized_xyxy` argument of `sv.denormalize_boxes` (use `xyxy`); the `supervision.dataset.utils` import path for `sv.mask_to_rle`/`sv.rle_to_mask` (import from `supervision.detection.utils.converters` instead); `sv.LMM` and `Detections.from_lmm` (use `sv.VLM`/`Detections.from_vlm`); and the legacy `MeanAveragePrecision` in `supervision.metrics.detection` (use `supervision.metrics.mean_average_precision.MeanAveragePrecision`, exposed as `sv.metrics.MeanAveragePrecision`). See [Deprecated](deprecated.md) for the full list. [#2582](https://github.com/roboflow/supervision/pull/2582)
docs/how_to/track_objects.md:704
ByteTrackTracker.update()can returntracker_id == -1for pending/unmatched detections. Feeding those rows intoDetectionsSmoothermerges all pending objects into one synthetic history, so this migrated example can produce incorrect smoothed boxes; filter pending IDs before smoothing.
detections = tracker.update(detections)
docs/how_to/track_objects.md:745
ByteTrackTracker.update()can returntracker_id == -1for pending/unmatched detections. Feeding those rows intoDetectionsSmoothermerges all pending objects into one synthetic history, so this migrated example can produce incorrect smoothed boxes; filter pending IDs before smoothing.
detections = tracker.update(detections)
docs/trackers.md:1
- Deleting this page leaves live links in current docstrings pointing at
/latest/trackers/, includingTraceAnnotator(src/supervision/annotators/core.py:2060),LineZone(src/supervision/detection/line_zone.py:37),PolygonZone(src/supervision/detection/tools/polygon_zone.py:25), and the smoother warning (src/supervision/detection/tools/smoother.py:148). Update those links to the external trackers documentation or a supported tracking guide before removing the target page, otherwise the new latest docs will contain broken links.
examples/heatmap_and_track/rfdetr_example.py:89 - The external tracker uses
-1for detections that do not yet have a confirmed ID. This labels those detections as#-1, exposing a fake shared track in the migrated example; filter pending IDs before constructing labels.
detections = byte_tracker.update(detections) # update tracker
examples/heatmap_and_track/script.py:93
- The external tracker uses
-1for detections that do not yet have a confirmed ID. This labels those detections as#-1, exposing a fake shared track in the migrated example; filter pending IDs before constructing labels.
detections = byte_tracker.update(detections) # update tracker
examples/speed_estimation/inference_example.py:106
ByteTrackTracker.update()can returntracker_id == -1for pending/unmatched detections. This code stores coordinates by ID, so unrelated pending detections share the-1trajectory and can produce incorrect speed estimates; filter pending IDs before calculating anchors and speeds.
detections = byte_track.update(detections)
examples/speed_estimation/rfdetr_example.py:106
ByteTrackTracker.update()can returntracker_id == -1for pending/unmatched detections. This code stores coordinates by ID, so unrelated pending detections share the-1trajectory and can produce incorrect speed estimates; filter pending IDs before calculating anchors and speeds.
detections = byte_track.update(detections)
examples/speed_estimation/ultralytics_example.py:90
ByteTrackTracker.update()can returntracker_id == -1for pending/unmatched detections. This code stores coordinates by ID, so unrelated pending detections share the-1trajectory and can produce incorrect speed estimates; filter pending IDs before calculating anchors and speeds.
detections = byte_track.update(detections)
examples/speed_estimation/yolo_nas_example.py:93
ByteTrackTracker.update()can returntracker_id == -1for pending/unmatched detections. This code stores coordinates by ID, so unrelated pending detections share the-1trajectory and can produce incorrect speed estimates; filter pending IDs before calculating anchors and speeds.
detections = byte_track.update(detections)
examples/time_in_zone/inference_file_example.py:58
ByteTrackTracker.update()can returntracker_id == -1for pending/unmatched detections. The timer stores the ID as a persistent key, so unrelated pending detections share one timer and their time-in-zone values become incorrect; filter pending IDs before callingtimer.tick.
detections = tracker.update(detections)
examples/time_in_zone/inference_naive_stream_example.py:61
ByteTrackTracker.update()can returntracker_id == -1for pending/unmatched detections. The timer stores the ID as a persistent key, so unrelated pending detections share one timer and their time-in-zone values become incorrect; filter pending IDs before callingtimer.tick.
detections = tracker.update(detections)
examples/time_in_zone/inference_stream_example.py:39
ByteTrackTracker.update()can returntracker_id == -1for pending/unmatched detections. The timer stores the ID as a persistent key, so unrelated pending detections share one timer and their time-in-zone values become incorrect; filter pending IDs before callingtimer.tick.
detections = self.tracker.update(detections)
examples/time_in_zone/rfdetr_file_example.py:135
ByteTrackTracker.update()can returntracker_id == -1for pending/unmatched detections. The timer stores the ID as a persistent key, so unrelated pending detections share one timer and their time-in-zone values become incorrect; filter pending IDs before callingtimer.tick.
detections = tracker.update(detections)
examples/time_in_zone/rfdetr_naive_stream_example.py:138
ByteTrackTracker.update()can returntracker_id == -1for pending/unmatched detections. The timer stores the ID as a persistent key, so unrelated pending detections share one timer and their time-in-zone values become incorrect; filter pending IDs before callingtimer.tick.
detections = tracker.update(detections)
examples/time_in_zone/rfdetr_stream_example.py:101
ByteTrackTracker.update()can returntracker_id == -1for pending/unmatched detections. The timer stores the ID as a persistent key, so unrelated pending detections share one timer and their time-in-zone values become incorrect; filter pending IDs before callingtimer.tick.
detections = self.tracker.update(detections)
examples/time_in_zone/ultralytics_file_example.py:62
ByteTrackTracker.update()can returntracker_id == -1for pending/unmatched detections. The timer stores the ID as a persistent key, so unrelated pending detections share one timer and their time-in-zone values become incorrect; filter pending IDs before callingtimer.tick.
examples/time_in_zone/ultralytics_naive_stream_example.py:65ByteTrackTracker.update()can returntracker_id == -1for pending/unmatched detections. The timer stores the ID as a persistent key, so unrelated pending detections share one timer and their time-in-zone values become incorrect; filter pending IDs before callingtimer.tick.
examples/time_in_zone/ultralytics_stream_example.py:39ByteTrackTracker.update()can returntracker_id == -1for pending/unmatched detections. The timer stores the ID as a persistent key, so unrelated pending detections share one timer and their time-in-zone values become incorrect; filter pending IDs before callingtimer.tick.
examples/traffic_analysis/inference_example.py:165ByteTrackTracker.update()can returntracker_id == -1for pending/unmatched detections.DetectionsManageruses IDs as persistent zone keys, so passing these rows through makes unrelated pending objects share one ID and can corrupt entry/exit counts; filter pending IDs before updating the manager.
examples/traffic_analysis/rfdetr_example.py:173ByteTrackTracker.update()can returntracker_id == -1for pending/unmatched detections.DetectionsManageruses IDs as persistent zone keys, so passing these rows through makes unrelated pending objects share one ID and can corrupt entry/exit counts; filter pending IDs before updating the manager.
examples/traffic_analysis/ultralytics_example.py:162ByteTrackTracker.update()can returntracker_id == -1for pending/unmatched detections.DetectionsManageruses IDs as persistent zone keys, so passing these rows through makes unrelated pending objects share one ID and can corrupt entry/exit counts; filter pending IDs before updating the manager.
src/supervision/detection/tools/smoother.py:42- This warning now points users to the external tracker docs, but the same class's runtime warning below still links to the removed
https://supervision.roboflow.com/latest/trackerspage. Update that warning too so users who callDetectionsSmoother.update_with_detectionsdo not receive a dead migration link.
src/supervision/detection/tools/smoother.py:95 ByteTrackTracker.update()can return detections withtracker_id == -1while a track is pending or unmatched. Passing those rows intoDetectionsSmoothermakes every pending object share the-1history, so their boxes can be averaged together; filter pending IDs before smoothing (and before other consumers that treat IDs as stable keys).
- Files reviewed: 71/73 changed files
- Comments generated: 5
- Review effort level: Lite
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved tracking migration issues include pending -1 ID handling and activation-threshold mismatches.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (41)
Previously missed (20) — in code that hasn't changed since the last review.
examples/heatmap_and_track/rfdetr_example.py:92
- The external tracker keeps unconfirmed detections with
tracker_id=-1, and the next block builds labels from every returned detection. This makes the heatmap example display#-1for pending objects and gives multiple objects the same identity; filter pending IDs afterupdate()before annotating and creating labels.
examples/heatmap_and_track/script.py:93 - The external tracker can return an unconfirmed detection with
tracker_id=-1. This result is sent to the heatmap annotator and the label generation below, so pending objects are visualized and reused as a real track under the shared-1ID. Filter pending IDs immediately afterbyte_tracker.update.
examples/speed_estimation/inference_example.py:106 - The external tracker can emit
tracker_id=-1for an unconfirmed detection. This value is inserted intocoordinates, so unrelated pending detections share one speed history and can later produce a bogus#-1speed label; filter pending IDs before updating the history.
examples/speed_estimation/rfdetr_example.py:106 ByteTrackTracker.update()keeps detections that have not yet reachedminimum_consecutive_framesand marks them withtracker_id=-1, whereas the removed wrapper filtered those detections out. Appending every returned point here makes first-frame detections from unrelated objects sharecoordinates[-1], corrupting their speed histories; filter pending IDs immediately after the update before building coordinates and labels.
examples/speed_estimation/ultralytics_example.py:93- The external tracker can emit
tracker_id=-1for an unconfirmed detection. This value is inserted intocoordinates, so unrelated pending detections share one speed history and can later produce a bogus#-1speed label; filter pending IDs before updating the history.
examples/speed_estimation/yolo_nas_example.py:93 - The external tracker can emit
tracker_id=-1for an unconfirmed detection. This value is inserted intocoordinates, so unrelated pending detections share one speed history and can later produce a bogus#-1speed label; filter pending IDs before updating the history.
examples/time_in_zone/inference_file_example.py:58 ByteTrackTracker.update()returns newly seen/unconfirmed detections with the shared pending ID-1. Passing those detections directly intoFPSBasedTimermakes unrelated objects share one timer entry and loses their pre-confirmation dwell time when they receive real IDs; filtertracker_id != -1before the zone/timer loop.
examples/time_in_zone/inference_naive_stream_example.py:61- The tracker can return unconfirmed detections with
tracker_id=-1, but those detections are sent directly to the zone timers and labels below. Pending objects will therefore share the-1timer/label; filter them immediately aftertracker.update.
examples/time_in_zone/inference_stream_example.py:39 - The tracker can return unconfirmed detections with
tracker_id=-1, but those detections are sent directly to the zone timers and labels below. Pending objects will therefore share the-1timer/label; filter them immediately aftertracker.update.
examples/time_in_zone/rfdetr_file_example.py:135 - The tracker can return unconfirmed detections with
tracker_id=-1, but those detections are sent directly toFPSBasedTimerand the labels below. Pending objects will therefore share the-1timer/label; filter them immediately aftertracker.update.
examples/time_in_zone/rfdetr_naive_stream_example.py:135 - The tracker can return unconfirmed detections with
tracker_id=-1, but those detections are sent directly to the zone timers and labels below. Pending objects will therefore share the-1timer/label; filter them immediately aftertracker.update.
examples/time_in_zone/rfdetr_stream_example.py:101 - The tracker can return unconfirmed detections with
tracker_id=-1, but those detections are sent directly to the zone timers and labels below. Pending objects will therefore share the-1timer/label; filter them immediately aftertracker.update.
examples/time_in_zone/ultralytics_file_example.py:62 - The tracker can return unconfirmed detections with
tracker_id=-1, but those detections are sent directly toFPSBasedTimerand the labels below. Pending objects will therefore share the-1timer/label; filter them immediately aftertracker.update.
examples/time_in_zone/ultralytics_naive_stream_example.py:65 - The tracker can return unconfirmed detections with
tracker_id=-1, but those detections are sent directly to the zone timers and labels below. Pending objects will therefore share the-1timer/label; filter them immediately aftertracker.update.
examples/time_in_zone/ultralytics_stream_example.py:39 - The tracker can return unconfirmed detections with
tracker_id=-1, but those detections are sent directly to the zone timers and labels below. Pending objects will therefore share the-1timer/label; filter them immediately aftertracker.update.
examples/traffic_analysis/inference_example.py:165 - The traffic
DetectionsManagerstores every ID from the zone slices, but the external tracker emits-1for unconfirmed detections. Keeping this update result unfiltered causes unrelated pending detections to share one zone entry and can produce incorrect in/out counts; remove pending IDs before passing detections to the zones and manager.
examples/traffic_analysis/rfdetr_example.py:173 - The tracker can return unconfirmed detections with
tracker_id=-1, but the full result is passed to the zone triggers andDetectionsManager. Pending detections can therefore enter traffic counts and state transitions under the shared-1ID; filter them before the zone bookkeeping.
examples/traffic_analysis/ultralytics_example.py:162 - The tracker can return unconfirmed detections with
tracker_id=-1, but the full result is passed to the zone triggers andDetectionsManager. Pending detections can therefore enter traffic counts and state transitions under the shared-1ID; filter them before the zone bookkeeping.
docs/llms.full.txt:48 - The mAP paragraph later in this generated file still says the removed top-level
sv.MeanAveragePrecision.from_detections()is merely deprecated. Because this PR removes that symbol fromsupervision.__init__, readers following the current documentation will be directed to an API that raisesAttributeError; describe it as removed in 0.31.0 instead.
docs/llms.txt:44 - The mAP paragraph later in this generated file still says the removed top-level
sv.MeanAveragePrecision.from_detections()is merely deprecated. Because this PR removes that symbol fromsupervision.__init__, readers following the current documentation will be directed to an API that raisesAttributeError; describe it as removed in 0.31.0 instead.
docs/detection/annotators.md:405
ByteTrackTracker.update()can return unconfirmed detections withtracker_id == -1, so this tracking example can pass a shared-1ID intoTraceAnnotator. Filtertracker_id != -1before annotation, as required by the tracker output contract.
detections = tracker.update(detections)
docs/how_to/track_objects.md:135
ByteTrackTracker.update()can return unconfirmed detections withtracker_id == -1, so the first sample does not actually give every returned detection a unique tracker ID and can feed-1into later annotations. Filtertracker_id != -1after every tracker update in the repeated samples on this page, or explicitly document that unconfirmed rows must be discarded.
detections = tracker.update(detections)
docs/how_to/track_objects.md:119
- The warning says the samples below still “need that substitution,” but every sample below already imports
ByteTrackTrackerand callsupdate(). This makes the migration guidance inaccurate; state that the samples already use the replacement and only require the externaltrackersdependency.
`sv.ByteTrack` was removed as of `supervision-0.31.0`. Use `ByteTrackTracker` from the external `trackers` package (`pip install trackers`) instead. The external tracker uses `update()` instead of `update_with_detections()`; the samples below need that substitution to run on `supervision>=0.31.0`.
examples/time_in_zone/inference_file_example.py:37
- The model accepts detections down to
confidence_threshold(default0.3), butByteTrackTrackerdefaultstrack_activation_thresholdto0.7. Detections in that interval therefore remain pending withtracker_id=-1and are not tracked, changing the behavior of this example; pass the function'sconfidence_thresholdto the tracker explicitly.
tracker = ByteTrackTracker(minimum_iou_threshold=0.5)
examples/time_in_zone/inference_naive_stream_example.py:37
- The model uses
confidence_thresholdto filter detections, but this tracker keeps its defaulttrack_activation_threshold=0.7. With the example's default threshold of 0.3, detections in the 0.3–0.7 range are never activated and therefore disappear from the zone timers. Passtrack_activation_threshold=confidence_thresholdto preserve the documented model threshold.
tracker = ByteTrackTracker(minimum_iou_threshold=0.5)
examples/time_in_zone/rfdetr_file_example.py:116
- The model uses
confidence_thresholdto filter detections, but this tracker keeps its defaulttrack_activation_threshold=0.7. With the example's default threshold of 0.3, detections in the 0.3–0.7 range are never activated and therefore disappear from the zone timers. Passtrack_activation_threshold=confidence_thresholdto preserve the documented model threshold.
tracker = ByteTrackTracker(minimum_iou_threshold=0.5)
examples/time_in_zone/rfdetr_naive_stream_example.py:116
- The model uses
confidence_thresholdto filter detections, but this tracker keeps its defaulttrack_activation_threshold=0.7. With the example's default threshold of 0.3, detections in the 0.3–0.7 range are never activated and therefore disappear from the zone timers. Passtrack_activation_threshold=confidence_thresholdto preserve the documented model threshold.
tracker = ByteTrackTracker(minimum_iou_threshold=0.5)
examples/time_in_zone/ultralytics_file_example.py:37
- The model uses
confidence_thresholdto filter detections, but this tracker keeps its defaulttrack_activation_threshold=0.7. With the example's default threshold of 0.3, detections in the 0.3–0.7 range are never activated and therefore disappear from the zone timers. Passtrack_activation_threshold=confidence_thresholdto preserve the documented model threshold.
examples/time_in_zone/ultralytics_naive_stream_example.py:37 - The model uses
confidence_thresholdto filter detections, but this tracker keeps its defaulttrack_activation_threshold=0.7. With the example's default threshold of 0.3, detections in the 0.3–0.7 range are never activated and therefore disappear from the zone timers. Passtrack_activation_threshold=confidence_thresholdto preserve the documented model threshold.
examples/tracking/inference_example.py:37 confidence_thresholdcontrols model inference here (default0.3), but the migrated tracker uses its0.7default activation threshold. Detections accepted by the model but below0.7are returned with pending ID-1, so the example no longer assigns IDs to all detections accepted by its configured threshold; passconfidence_thresholdtoByteTrackTracker.
examples/tracking/inference_example.py:46- The external tracker returns unconfirmed detections with
tracker_id=-1, but this example labels every returned detection. That exposes a shared, non-object ID (#-1) during activation and differs from the removed wrapper, which returned only matched detections; filter pending IDs before annotating.
examples/tracking/rfdetr_example.py:27 - The external tracker keeps its default
track_activation_threshold=0.7, while this example filters model detections using the lowerconfidence_threshold. Valid detections below 0.7 are therefore passed into the tracker but never activated, so the tracking example silently omits detections that the model accepted. Passtrack_activation_threshold=confidence_thresholdwhen constructing the tracker.
examples/tracking/rfdetr_example.py:38 - The tracker can return unconfirmed detections with
tracker_id=-1, but the result is passed to the annotators and labels below. This displays a pending object as#-1instead of withholding a track label; filter pending IDs before annotation.
examples/tracking/ultralytics_example.py:26 - The external tracker keeps its default
track_activation_threshold=0.7, while this example filters model detections using the lowerconfidence_threshold. Valid detections below 0.7 are therefore passed into the tracker but never activated, so the tracking example silently omits detections that the model accepted. Passtrack_activation_threshold=confidence_thresholdwhen constructing the tracker.
examples/tracking/ultralytics_example.py:38 - The tracker can return unconfirmed detections with
tracker_id=-1, but the result is passed to the annotators and labels below. This displays a pending object as#-1instead of withholding a track label; filter pending IDs before annotation.
examples/traffic_analysis/inference_example.py:89 - The model threshold is stored in
self.conf_thresholdand defaults to0.3, whileByteTrackTrackerdefaults to a0.7activation threshold. Low-confidence detections are consequently returned only with pending ID-1and cannot participate in the traffic counts; passself.conf_thresholdwhen constructing the tracker.
examples/traffic_analysis/rfdetr_example.py:94 - The external tracker keeps its default
track_activation_threshold=0.7, while this example filters model detections using the lowerconfidence_threshold. Valid detections below 0.7 are therefore passed into the tracker but never activated, so traffic-zone transitions are missed. Passtrack_activation_threshold=confidence_thresholdwhen constructing the tracker.
examples/traffic_analysis/ultralytics_example.py:86 - The external tracker keeps its default
track_activation_threshold=0.7, while this example filters model detections using the lowerconfidence_threshold. Valid detections below 0.7 are therefore passed into the tracker but never activated, so traffic-zone transitions are missed. Passtrack_activation_threshold=confidence_thresholdwhen constructing the tracker.
src/supervision/annotators/core.py:2166 ByteTrackTracker.update()can return unconfirmed detections withtracker_id == -1; passing them toTraceAnnotatorcauses unrelated unconfirmed objects to share one trace ID. Filtertracker_id != -1before annotating, and apply the same adjustment to the repeated tracking snippets in the guide.
src/supervision/annotators/core.py:2154- This PR removes
docs/trackers.md, but theTraceAnnotatordocumentation in this same file still links to/latest/trackers/at lines 2060-2061. The generated API page will therefore expose a dead link after this removal; update it (and the analogous LineZone/PolygonZone links) to the external trackers documentation or the migration guidance.
src/supervision/detection/tools/smoother.py:95 ByteTrackTracker.update()can return unconfirmed detections withtracker_id == -1. Passing those rows directly intoDetectionsSmoothermakes all unconfirmed objects share one smoothing track because the smoother keys state by ID. Filter invalid/unconfirmed IDs before callingupdate_with_detections()in this example.
- Files reviewed: 71/73 changed files
- Comments generated: 3
- Review effort level: Lite
d324b09 to
164725a
Compare
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
🔵 Needs a closer look
One moderate documentation issue and six migration/documentation nits remain unresolved.
Review details
Suppressed comments (7)
docs/deprecated.md:19
- Removing
docs/trackers.mdleaves the currentDetectionsAPI docstring link[trackers](/trackers/)insrc/supervision/detection/core.py:118pointing to a page that no longer exists, so generated documentation will expose a 404. Update that link to the external trackers documentation or the tracking how-to before deleting the page.
- `sv.ByteTrack` was removed as of `supervision-0.31.0`. Use `ByteTrackTracker` from the external [`trackers`](https://pypi.org/project/trackers/) package (`pip install trackers`) instead; its update method is `update()`, not `update_with_detections()`.
docs/detection/annotators.md:400
- This duplicate public documentation example relies on
ByteTrackTrackerdefaults, which differ from the removedsv.ByteTrackdefaults: activation is 0.7 instead of 0.25 and two consecutive frames are required instead of one. Set the intended thresholds explicitly so the migrated example does not unexpectedly drop lower-confidence objects or delay IDs.
tracker = ByteTrackTracker()
docs/how_to/count_in_zone.md:145
ByteTrackTrackerreturnstracker_id=-1for unconfirmed detections, so this recipe can add-1to theseenset and count pending detections as a real object. Filterdetections.tracker_id != -1before applying the zone mask or updating the set, as the migrated tracking examples do.
Yes. You can pass tracker IDs from `ByteTrackTracker` (external `trackers` package; `sv.ByteTrack` was removed as of `supervision-0.31.0`) alongside your detections, but `sv.PolygonZone` still evaluates the zone on each frame and reports which objects are currently inside it. If you want to count each object only once when it first enters the zone, maintain a set of seen `tracker_id` values after filtering detections with `zone.trigger(detections)`, or use a dedicated entry/crossing counting tool such as `sv.LineZone` when it better matches your use case.
docs/how_to/track_objects.md:119
- The external tracker's defaults are not equivalent to the removed
sv.ByteTrack:track_activation_thresholdis 0.7 (versus 0.25) andminimum_consecutive_framesis 2 (versus 1). Because every sample below constructsByteTrackTracker()without overrides, this migration silently suppresses lower-confidence tracks and delays IDs; please pass explicit values or document these changed defaults in the examples.
`sv.ByteTrack` was removed as of `supervision-0.31.0`. The samples below already use `ByteTrackTracker` from the external `trackers` package — install it with `pip install trackers` before running them. If you're migrating your own code from `sv.ByteTrack`, note that the external tracker's update method is `update()`, not `update_with_detections()`.
docs/notebooks/serialise-detections-to-csv.ipynb:159
- This notebook paragraph still contains the incomplete sentence
Initialize the object.after the tracker migration, so readers are not told what the following initialization is for. Name the newByteTrackTrackerobject here.
"[ByteTrack](https://trackers.roboflow.com/latest/) is a multi-object tracking algorithm from the external `trackers` package. It tracks and links detected objects across multiple frames, providing consistent IDs for each object.Initialize the object."
src/supervision/annotators/core.py:2162
- This public
TraceAnnotatorexample also relies onByteTrackTrackerdefaults, which differ from the removedsv.ByteTrackdefaults: activation is 0.7 instead of 0.25 and two consecutive frames are required instead of one. Set the intended thresholds explicitly so the documented example does not unexpectedly drop lower-confidence objects or delay IDs after the migration.
src/supervision/detection/tools/smoother.py:87 - This migrated
DetectionsSmootherexample keeps onlyframe_rateand inherits the external tracker's defaults, which are not equivalent to the removedsv.ByteTrackdefaults: activation is 0.7 instead of 0.25 and two consecutive frames are required instead of one. Set the intended thresholds explicitly so smoothing does not unexpectedly omit lower-confidence or first-frame tracks.
- Files reviewed: 78/80 changed files
- Comments generated: 0 new
- Review effort level: Lite
Changes: - Move the scheduled 0.31.0 API removals from deprecation notices into removal guidance and eliminate obsolete public API references. - Update migration documentation, examples, notebook text, and public docstrings for the external ByteTrackTracker API. - Preserve the removed wrapper settings in migrated tracker examples, filter unconfirmed tracker IDs in the zone recipe, and replace the deleted tracker-page link. Impact: - Users receive valid tracker documentation links and migration examples that preserve the previous tracking behavior. - Zone-counting guidance no longer treats unconfirmed detections as distinct tracked objects. - Generated API documentation no longer links to the deleted tracker page. Verification: - uv run pre-commit run --files <seven remediation paths> passed. - uv run --group docs --offline mkdocs build --strict passed. - Notebook JSON parsing and git diff --check HEAD passed. Residual limits: - The documentation build emitted existing warnings outside the amended files. - A pre-existing uncommitted uv.lock change was returned to the committed version and could not be reconstructed. --- Co-authored-by: Codex <[email protected]>
164725a to
0576502
Compare
AGENTS.md section 6 requires each changelog entry to link the PR rather than the source issue. The entry was added before this PR had a number, so the link is appended now, in the same trailing style as the roboflow#2582 and roboflow#2588 entries.
This pull request finalizes the removal of several deprecated features in the Supervision library as scheduled for version 0.31.0. The changes update documentation, public APIs, and import paths to eliminate references to removed utilities, modules, and arguments, and guide users toward their replacements. The most notable removals are the built-in
sv.ByteTracktracker, the legacy keypoint and image utilities, and the legacy mean average precision metric. Documentation throughout the project has been updated to reflect these removals and to direct users to supported alternatives.Removals and API changes:
sv.ByteTrack(useByteTrackTrackerfrom the externaltrackerspackage)supervision.keypointmodule (usesupervision.key_points)create_tilesandoverlay_imageinsupervision.utils.imageensure_cv2_image_for_annotation,ensure_pil_image_for_annotation, andensure_cv2_image_for_processinginsupervision.utils.conversionvalidate_keypoint_confidenceandvalidate_keypoints_fieldsinsupervision.validatorsnormalized_xyxyargument ofsv.denormalize_boxes(usexyxy)supervision.dataset.utilsimport path forsv.mask_to_rle/sv.rle_to_mask(import fromsupervision.detection.utils.converters)sv.LMMandDetections.from_lmm(usesv.VLM/Detections.from_vlm)MeanAveragePrecisioninsupervision.metrics.detection(usesupervision.metrics.mean_average_precision.MeanAveragePrecisionorsv.metrics.MeanAveragePrecision) [1] [2] [3] [4]Documentation updates:
trackers.mdAPI reference page forsv.ByteTrack[1] [2].Deprecation and changelog maintenance:
deprecated.mdandchangelog.mddocumentation, clarifying upgrade paths and alternatives [1] [2] [3] [4].These changes ensure that users are directed to the current, supported APIs and that the documentation accurately reflects the state of the library as of version 0.31.0.