supervision/tests
Jirka Borovec eea04b3656
fix(detection): harden model connectors and mask extraction (#2398)
- `from_tensorflow` scaled boxes in place on the array returned by `.numpy()`, which can share memory with the source tensor — corrupting caller data and double-scaling on a repeat call; copy before scaling
- `from_lmm` raised a bare `KeyError` for `MOONDREAM` and `QWEN_3_VL`, which the enum and docstring advertise; map both to their `VLM` members
- `from_deepseek_vl_2` returned a `(0,)`-shaped `xyxy` on empty output, so a zero-detection response crashed the `Detections` constructor; return `(0, 4)` like the other parsers
- `extract_ultralytics_masks` binarized bilinear-resized masks with `> 0`, dilating every mask at object boundaries; threshold at 0.5 to match Ultralytics
- add connector coverage: fake-result shims and round-trip tests (N>1, N=1, empty) for the nine previously untested `from_*` connectors and the `detection/tools/transformers.py` processors; one empty-`segments_info` panoptic case is xfail-marked pending a separate fix

* test(ci-fix): drop deprecated Pillow mode arg from panoptic helpers
* test(coverage): add from_qwen_3_vl end-to-end parametrized tests
* test(quality): harden test isolation, xfail strictness, and kwarg forwarding
* fix(detection): fix class_name empty dtype; annotate mask threshold asymmetry
* chore: ruff-format cleanup (blank lines)

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
2026-07-03 20:09:57 +02:00
..
annotators fix(annotators): clip BackgroundOverlayAnnotator boxes to the scene… (#2396) 2026-07-03 18:36:25 +02:00
assets chore: bump minimum Python to 3.10 (#2260) 2026-06-29 14:45:30 +02:00
classification refactor docstrings in `draw`, `classification`, and `key_points` (#2161) 2026-03-10 18:07:39 +01:00
dataset fix(dataset): stop split mutation, determinize VOC, guard collisions (#2394) 2026-07-03 15:02:01 +02:00
detection fix(detection): harden model connectors and mask extraction (#2398) 2026-07-03 20:09:57 +02:00
draw perf(annotators): skip corner circles when drawing square label backgrounds (#2346) 2026-07-01 01:25:25 +02:00
geometry fix: replace deprecated 2-D np.cross with explicit determinant (#2386) 2026-07-02 19:01:39 +02:00
key_points chore(typing): Add explicit selection helpers (#2373) 2026-06-29 15:39:58 +02:00
metrics fix(metrics): count false positives on empty-GT images (#2397) 2026-07-03 16:17:08 +02:00
tracker chore: bump minimum Python to 3.10 (#2260) 2026-06-29 14:45:30 +02:00
utils fix(annotators): clip crops, fix heatmap wrap, release capture (#2393) 2026-07-03 11:03:45 +02:00
__init__.py refactor: reorganize project structure and update module imports (#2112) 2026-02-03 15:24:47 +01:00
conftest.py chore: bump minimum Python to 3.10 (#2260) 2026-06-29 14:45:30 +02:00
helpers.py fix(detection): harden model connectors and mask extraction (#2398) 2026-07-03 20:09:57 +02:00
test_validate_deprecations.py chore: bump minimum Python to 3.10 (#2260) 2026-06-29 14:45:30 +02:00