supervision/tests
Jirka Borovec f173905c8b
fix(dataset): stop split mutation, determinize VOC, guard collisions (#2394)
- `train_test_split` seeded the global `random` module and shuffled the caller's list in place, so `DetectionDataset.split()` reordered its own `image_paths` and polluted process-wide randomness; use a local `random.Random` and shuffle a copy
- Pascal VOC class ids were assigned in `set`-iteration and filesystem-glob order, so the same dataset produced different `class_id` values across runs; sort class names and the loaded file list
- dataset exports keyed output files on basename, silently overwriting when two entries shared a name across directories (common after `merge()`); detect basename collisions and raise
- add regression tests for split determinism, VOC id stability, and export collisions

* fix(dataset): add LabelMe collision guard, hoist pre-flight checks, make guard private
* test(dataset): add collision guard tests for as_yolo, as_pascal_voc, and boundary cases
* docs(dataset): document ValueError raises, fix stale docstrings, add non-mutation guarantee

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-07-03 15:02:01 +02:00
..
annotators fix(annotators): clip crops, fix heatmap wrap, release capture (#2393) 2026-07-03 11:03:45 +02:00
assets
classification
dataset fix(dataset): stop split mutation, determinize VOC, guard collisions (#2394) 2026-07-03 15:02:01 +02:00
detection fix: replace deprecated 2-D np.cross with explicit determinant (#2386) 2026-07-02 19:01:39 +02:00
draw
geometry fix: replace deprecated 2-D np.cross with explicit determinant (#2386) 2026-07-02 19:01:39 +02:00
key_points
metrics Fix: resolve major complex review (#2388) 2026-07-02 18:14:04 +02:00
tracker
utils fix(annotators): clip crops, fix heatmap wrap, release capture (#2393) 2026-07-03 11:03:45 +02:00
__init__.py
conftest.py
helpers.py
test_validate_deprecations.py