Skip to content

chore(deprecation): remove scheduled for removal in 0.31.0 [rebase&merge] - #2582

Merged
Borda merged 10 commits into
developfrom
prune/depr-0.31
Sep 16, 2026
Merged

Borda merged 10 commits into
developfrom
prune/depr-0.31

Conversation

@Borda

@Borda Borda commented Sep 16, 2026

Copy link
Copy Markdown
Member

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.ByteTrack tracker, 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:

  • Removed the following from the public API and documentation [1] [2]:
    • sv.ByteTrack (use ByteTrackTracker from the external trackers package)
    • 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)
    • sv.LMM and Detections.from_lmm (use sv.VLM/Detections.from_vlm)
    • The legacy MeanAveragePrecision in supervision.metrics.detection (use supervision.metrics.mean_average_precision.MeanAveragePrecision or sv.metrics.MeanAveragePrecision) [1] [2] [3] [4]

Documentation updates:

  • Updated all documentation and guides to remove references to the deprecated features, replacing them with their supported alternatives and adding explicit removal notes and migration instructions [1] [2] [3] [4] [5] [6] [7] [8] [9].
  • Removed the dedicated trackers.md API reference page for sv.ByteTrack [1] [2].

Deprecation and changelog maintenance:

  • Moved all features scheduled for removal in 0.31.0 from the deprecated lists to the removed lists in the deprecated.md and changelog.md documentation, 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.

Borda and others added 8 commits September 16, 2026 15:54
`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]>
@Borda
Borda requested a balanced review from Copilot September 16, 2026 14:45
@Borda
Borda requested a review from SkalskiP as a code owner September 16, 2026 14:45
@Borda Borda added the enhancement New feature or request label Sep 16, 2026
@codecov

codecov Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91%. Comparing base (560efc9) to head (0576502).

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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.

Comment thread docs/deprecated.md Resolved
Comment thread docs/faq.md Resolved
Comment thread docs/how_to/track_objects.md Resolved
Comment thread docs/changelog.md Resolved
Comment thread docs/deprecated.md Resolved
…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]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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.md leaves the existing unversioned link at docs/changelog.md:419 pointing 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 return tracker_id == -1 for pending/unmatched detections. Feeding those rows into DetectionsSmoother merges 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 return tracker_id == -1 for pending/unmatched detections. Feeding those rows into DetectionsSmoother merges 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/, including TraceAnnotator (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 -1 for 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 -1 for 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 return tracker_id == -1 for pending/unmatched detections. This code stores coordinates by ID, so unrelated pending detections share the -1 trajectory 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 return tracker_id == -1 for pending/unmatched detections. This code stores coordinates by ID, so unrelated pending detections share the -1 trajectory 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 return tracker_id == -1 for pending/unmatched detections. This code stores coordinates by ID, so unrelated pending detections share the -1 trajectory 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 return tracker_id == -1 for pending/unmatched detections. This code stores coordinates by ID, so unrelated pending detections share the -1 trajectory 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 return tracker_id == -1 for 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 calling timer.tick.
        detections = tracker.update(detections)

examples/time_in_zone/inference_naive_stream_example.py:61

  • ByteTrackTracker.update() can return tracker_id == -1 for 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 calling timer.tick.
        detections = tracker.update(detections)

examples/time_in_zone/inference_stream_example.py:39

  • ByteTrackTracker.update() can return tracker_id == -1 for 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 calling timer.tick.
        detections = self.tracker.update(detections)

examples/time_in_zone/rfdetr_file_example.py:135

  • ByteTrackTracker.update() can return tracker_id == -1 for 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 calling timer.tick.
        detections = tracker.update(detections)

examples/time_in_zone/rfdetr_naive_stream_example.py:138

  • ByteTrackTracker.update() can return tracker_id == -1 for 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 calling timer.tick.
        detections = tracker.update(detections)

examples/time_in_zone/rfdetr_stream_example.py:101

  • ByteTrackTracker.update() can return tracker_id == -1 for 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 calling timer.tick.
        detections = self.tracker.update(detections)

examples/time_in_zone/ultralytics_file_example.py:62

  • ByteTrackTracker.update() can return tracker_id == -1 for 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 calling timer.tick.
    examples/time_in_zone/ultralytics_naive_stream_example.py:65
  • ByteTrackTracker.update() can return tracker_id == -1 for 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 calling timer.tick.
    examples/time_in_zone/ultralytics_stream_example.py:39
  • ByteTrackTracker.update() can return tracker_id == -1 for 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 calling timer.tick.
    examples/traffic_analysis/inference_example.py:165
  • ByteTrackTracker.update() can return tracker_id == -1 for pending/unmatched detections. DetectionsManager uses 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:173
  • ByteTrackTracker.update() can return tracker_id == -1 for pending/unmatched detections. DetectionsManager uses 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:162
  • ByteTrackTracker.update() can return tracker_id == -1 for pending/unmatched detections. DetectionsManager uses 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/trackers page. Update that warning too so users who call DetectionsSmoother.update_with_detections do not receive a dead migration link.
    src/supervision/detection/tools/smoother.py:95
  • ByteTrackTracker.update() can return detections with tracker_id == -1 while a track is pending or unmatched. Passing those rows into DetectionsSmoother makes every pending object share the -1 history, 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

Comment thread examples/heatmap_and_track/script.py Resolved
Comment thread docs/detection/annotators.md Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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 #-1 for pending objects and gives multiple objects the same identity; filter pending IDs after update() 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 -1 ID. Filter pending IDs immediately after byte_tracker.update.
    examples/speed_estimation/inference_example.py:106
  • The external tracker can emit tracker_id=-1 for an unconfirmed detection. This value is inserted into coordinates, so unrelated pending detections share one speed history and can later produce a bogus #-1 speed label; filter pending IDs before updating the history.
    examples/speed_estimation/rfdetr_example.py:106
  • ByteTrackTracker.update() keeps detections that have not yet reached minimum_consecutive_frames and marks them with tracker_id=-1, whereas the removed wrapper filtered those detections out. Appending every returned point here makes first-frame detections from unrelated objects share coordinates[-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=-1 for an unconfirmed detection. This value is inserted into coordinates, so unrelated pending detections share one speed history and can later produce a bogus #-1 speed label; filter pending IDs before updating the history.
    examples/speed_estimation/yolo_nas_example.py:93
  • The external tracker can emit tracker_id=-1 for an unconfirmed detection. This value is inserted into coordinates, so unrelated pending detections share one speed history and can later produce a bogus #-1 speed 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 into FPSBasedTimer makes unrelated objects share one timer entry and loses their pre-confirmation dwell time when they receive real IDs; filter tracker_id != -1 before 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 -1 timer/label; filter them immediately after tracker.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 -1 timer/label; filter them immediately after tracker.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 to FPSBasedTimer and the labels below. Pending objects will therefore share the -1 timer/label; filter them immediately after tracker.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 -1 timer/label; filter them immediately after tracker.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 -1 timer/label; filter them immediately after tracker.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 to FPSBasedTimer and the labels below. Pending objects will therefore share the -1 timer/label; filter them immediately after tracker.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 -1 timer/label; filter them immediately after tracker.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 -1 timer/label; filter them immediately after tracker.update.
    examples/traffic_analysis/inference_example.py:165
  • The traffic DetectionsManager stores every ID from the zone slices, but the external tracker emits -1 for 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 and DetectionsManager. Pending detections can therefore enter traffic counts and state transitions under the shared -1 ID; 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 and DetectionsManager. Pending detections can therefore enter traffic counts and state transitions under the shared -1 ID; 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 from supervision.__init__, readers following the current documentation will be directed to an API that raises AttributeError; 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 from supervision.__init__, readers following the current documentation will be directed to an API that raises AttributeError; describe it as removed in 0.31.0 instead.

docs/detection/annotators.md:405

  • ByteTrackTracker.update() can return unconfirmed detections with tracker_id == -1, so this tracking example can pass a shared -1 ID into TraceAnnotator. Filter tracker_id != -1 before 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 with tracker_id == -1, so the first sample does not actually give every returned detection a unique tracker ID and can feed -1 into later annotations. Filter tracker_id != -1 after 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 ByteTrackTracker and calls update(). This makes the migration guidance inaccurate; state that the samples already use the replacement and only require the external trackers dependency.
    `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 (default 0.3), but ByteTrackTracker defaults track_activation_threshold to 0.7. Detections in that interval therefore remain pending with tracker_id=-1 and are not tracked, changing the behavior of this example; pass the function's confidence_threshold to the tracker explicitly.
    tracker = ByteTrackTracker(minimum_iou_threshold=0.5)

examples/time_in_zone/inference_naive_stream_example.py:37

  • The model uses confidence_threshold to filter detections, but this tracker keeps its default track_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. Pass track_activation_threshold=confidence_threshold to 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_threshold to filter detections, but this tracker keeps its default track_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. Pass track_activation_threshold=confidence_threshold to 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_threshold to filter detections, but this tracker keeps its default track_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. Pass track_activation_threshold=confidence_threshold to 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_threshold to filter detections, but this tracker keeps its default track_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. Pass track_activation_threshold=confidence_threshold to preserve the documented model threshold.
    examples/time_in_zone/ultralytics_naive_stream_example.py:37
  • The model uses confidence_threshold to filter detections, but this tracker keeps its default track_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. Pass track_activation_threshold=confidence_threshold to preserve the documented model threshold.
    examples/tracking/inference_example.py:37
  • confidence_threshold controls model inference here (default 0.3), but the migrated tracker uses its 0.7 default activation threshold. Detections accepted by the model but below 0.7 are returned with pending ID -1, so the example no longer assigns IDs to all detections accepted by its configured threshold; pass confidence_threshold to ByteTrackTracker.
    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 lower confidence_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. Pass track_activation_threshold=confidence_threshold when 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 #-1 instead 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 lower confidence_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. Pass track_activation_threshold=confidence_threshold when 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 #-1 instead 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_threshold and defaults to 0.3, while ByteTrackTracker defaults to a 0.7 activation threshold. Low-confidence detections are consequently returned only with pending ID -1 and cannot participate in the traffic counts; pass self.conf_threshold when 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 lower confidence_threshold. Valid detections below 0.7 are therefore passed into the tracker but never activated, so traffic-zone transitions are missed. Pass track_activation_threshold=confidence_threshold when 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 lower confidence_threshold. Valid detections below 0.7 are therefore passed into the tracker but never activated, so traffic-zone transitions are missed. Pass track_activation_threshold=confidence_threshold when constructing the tracker.
    src/supervision/annotators/core.py:2166
  • ByteTrackTracker.update() can return unconfirmed detections with tracker_id == -1; passing them to TraceAnnotator causes unrelated unconfirmed objects to share one trace ID. Filter tracker_id != -1 before 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 the TraceAnnotator documentation 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 with tracker_id == -1. Passing those rows directly into DetectionsSmoother makes all unconfirmed objects share one smoothing track because the smoother keys state by ID. Filter invalid/unconfirmed IDs before calling update_with_detections() in this example.
  • Files reviewed: 71/73 changed files
  • Comments generated: 3
  • Review effort level: Lite

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 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.md leaves the current Detections API docstring link [trackers](/trackers/) in src/supervision/detection/core.py:118 pointing 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 ByteTrackTracker defaults, which differ from the removed sv.ByteTrack defaults: 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

  • ByteTrackTracker returns tracker_id=-1 for unconfirmed detections, so this recipe can add -1 to the seen set and count pending detections as a real object. Filter detections.tracker_id != -1 before 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_threshold is 0.7 (versus 0.25) and minimum_consecutive_frames is 2 (versus 1). Because every sample below constructs ByteTrackTracker() 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 new ByteTrackTracker object 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 TraceAnnotator example also relies on ByteTrackTracker defaults, which differ from the removed sv.ByteTrack defaults: 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 DetectionsSmoother example keeps only frame_rate and inherits the external tracker's defaults, which are not equivalent to the removed sv.ByteTrack defaults: 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]>
@Borda
Borda merged commit 19649ac into develop Sep 16, 2026
39 checks passed
@Borda
Borda deleted the prune/depr-0.31 branch September 16, 2026 20:23
Souptik96 added a commit to Souptik96/supervision that referenced this pull request Sep 18, 2026
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.
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.

2 participants