supervision/tests/detection/utils
Agis Kounelis 27ba0aa92f
fix(detection): do not crash `from_inference` on partial `tracker_id` (#2353)
process_roboflow_result appended tracker_id only for predictions that carried
one, while xyxy/confidence/class_id were appended for every prediction. A
result where some predictions are tracked and others are not produced a
tracker_id array shorter than the boxes, so Detections.from_inference raised
"tracker_id must be a 1D np.ndarray with shape (N,)".

Collect tracker_id for every prediction (None when absent) and build the array
only when all detections carry one, otherwise leave it None. Fully-tracked and
untracked results are unchanged.

---------

Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
2026-06-26 16:58:52 +02:00
..
__init__.py refactor: reorganize project structure and update module imports (#2112) 2026-02-03 15:24:47 +01:00
test_boxes.py fix(obb): NMM now computes geometric union via min-area rotated rect (#2312) 2026-06-15 16:23:31 +02:00
test_converters.py perf: vectorize `mask_to_xyxy` and `KeyPoints.as_detections` (bit-identical) (#2330) 2026-06-17 18:58:47 +02:00
test_internal.py fix(detection): do not crash `from_inference` on partial `tracker_id` (#2353) 2026-06-26 16:58:52 +02:00
test_iou_and_nms.py perf(detection): compute mask IoU via matmul instead of an (N, M, H, W) intermediate (#2323) 2026-06-18 10:45:56 +02:00
test_masks.py Add `match` arguments to all `pytest.raises` for more precise error validation in tests (#2145) 2026-02-10 21:22:55 +09:00
test_polygons.py fix(polygons): honor target point count in `approximate_polygon` (#2332) 2026-06-17 21:11:26 +02:00
test_vlms.py refactor: reorganize project structure and update module imports (#2112) 2026-02-03 15:24:47 +01:00