supervision/tests
Ruben 4b60bbc9cc
fix(dataset): stop Pascal VOC export from mutating source detections (#2341)
object_to_pascal_voc applied the 1-index offset in place (xyxy += 1).
Because Detections.__iter__ yields each row of xyxy as a view sharing
memory with detections.xyxy, detections_to_pascal_voc wrote the +1 shift
straight back into the caller's array. A single export shifted every box
by +1px; a second export compounded it, producing wrong XML. A single
export-then-reload happened to round-trip because from_pascal_voc
subtracts 1, which is why no test caught it.

Rebind to a new array (xyxy = xyxy + 1) instead of mutating in place.
On-disk output is unchanged; the source detections are left intact.

Add regression tests asserting object_to_pascal_voc does not mutate its
inputs and that two consecutive exports are identical and leave xyxy
unchanged.

---------

Co-authored-by: jirka <6035284+Borda@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
2026-06-18 15:29:37 +02:00
..
annotators perf(annotators): share mask painting and give HaloAnnotator the CompactMask path (#2339) 2026-06-18 12:37:11 +02:00
assets feat: replace print statements with structured logging (#2154) 2026-02-20 13:14:53 +01:00
classification refactor docstrings in `draw`, `classification`, and `key_points` (#2161) 2026-03-10 18:07:39 +01:00
dataset fix(dataset): stop Pascal VOC export from mutating source detections (#2341) 2026-06-18 15:29:37 +02:00
detection perf(detection): compute mask IoU via matmul instead of an (N, M, H, W) intermediate (#2323) 2026-06-18 10:45:56 +02:00
draw feat: add support for hexadecimal RGBA color format (#2004) 2026-03-30 15:57:18 +02:00
geometry
key_points feat: add `KeyPoints.with_nms()` method (#2338) 2026-06-18 10:42:43 +02:00
metrics fix(metrics): count false positives on background images and absent classes (#2331) 2026-06-17 19:46:10 +02:00
tracker Fix external track ids (#1364) 2026-02-20 00:58:55 +01:00
utils fix: normalize file extension filters (#2298) 2026-06-08 13:41:25 +02:00
__init__.py
conftest.py ci(tests): disable matplotlib GUI and exclude non-test dirs from collection (#2262) 2026-05-20 23:40:21 +02:00
helpers.py refactor: enrich `KeyPoints` with visibility mask, split confidence fields, and redesign uncertainty annotator (#2286) 2026-06-11 18:34:33 +02:00
test_validate_deprecations.py refactor: privatize validation helpers (#2294) 2026-06-06 13:15:54 -06:00