supervision/docs
Agis Kounelis ace3ebd03e
fix(detection): make `Detections.area` OBB-aware (#2306)
* fix(detection): make Detections.area OBB-aware

When detections carry ORIENTED_BOX_COORDINATES (the four xyxyxyxy corners),
the area property returned the area of the derived axis-aligned bounding
box instead of the rotated body. The AABB overestimates by up to ~2x for a
45-degree rotation, which silently miscomputes downstream values — most
visibly the area-sorted z-ordering inside MaskAnnotator / HaloAnnotator,
and any user code that filters detections by area.

* docs(detection): use string literal in Detections.area doctest
* test(detection): single-line docstring on test_uses_oriented_box_corners_when_present
* fix(detection): validate (N,4,2) shape of OBB data field in Detections.area
* perf(detection): replace np.roll pair with cross-diagonal shoelace in Detections.area
* perf(detection): cast x/y slices to float64 instead of full corners array
* refactor(detection): extract obb_polygon_area to detection/utils/boxes.py
* test(detection): add test_raises_on_malformed_obb_coordinates_shape
* test(detection): assert per-branch dtype contract for Detections.area
* docs(detection): document OBB dispatch contract and dtype in Detections.area docstring

---------

Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
2026-06-09 22:20:34 +02:00
..
assets
classification
datasets chore: update `mdformat` hook arguments to disable wrapping (#2307) 2026-06-09 16:15:05 +02:00
detection chore: update `mdformat` hook arguments to disable wrapping (#2307) 2026-06-09 16:15:05 +02:00
how_to chore: update `mdformat` hook arguments to disable wrapping (#2307) 2026-06-09 16:15:05 +02:00
javascripts docs: fix copy doctests without `>>>` and `...` by button & ctr+c (#2138) 2026-02-04 23:09:16 +09:00
keypoint feat(keypoints): add keypoint conversion bridge (#2277) 2026-05-28 10:36:41 +02:00
metrics fix(docs): expand llms.txt, add FAQ schema, author attribution to how… (#2231) 2026-04-23 18:33:14 +02:00
notebooks docs: link "Memory-Efficient Instance Segmentation" notebook and update deprecations (#2241) 2026-05-01 00:49:15 +02:00
stylesheets after few tests drop support for `pycon` in docs examples 2025-08-07 07:41:52 +02:00
theme docs: link "Memory-Efficient Instance Segmentation" notebook and update deprecations (#2241) 2026-05-01 00:49:15 +02:00
utils reimplement `crop_image` to skip type casting when Pillow Image given 2025-11-14 17:55:07 +01:00
0d5d9799b1cc4a39825146388c6781eb.txt feat(docs): add GEO infrastructure for AI search visibility (#2224) 2026-04-21 11:40:44 +02:00
CNAME
_headers docs: improve SEO and GEO docs publishing (#2232) 2026-04-24 23:39:22 +02:00
about.md docs: improve SEO and GEO docs publishing (#2232) 2026-04-24 23:39:22 +02:00
assets.md chore: update `mdformat` hook arguments to disable wrapping (#2307) 2026-06-09 16:15:05 +02:00
changelog.md fix(detection): make `Detections.area` OBB-aware (#2306) 2026-06-09 22:20:34 +02:00
code_of_conduct.md move CODE_OF_CONDUCT.md and CONTRIBUTING.md for improved accessibility (#2036) 2026-02-03 03:58:28 +01:00
contact.md docs: improve SEO and GEO docs publishing (#2232) 2026-04-24 23:39:22 +02:00
contributing.md move CODE_OF_CONDUCT.md and CONTRIBUTING.md for improved accessibility (#2036) 2026-02-03 03:58:28 +01:00
cookbooks.md fix(docs): expand llms.txt, add FAQ schema, author attribution to how… (#2231) 2026-04-23 18:33:14 +02:00
deprecated.md refactor: privatize validation helpers (#2294) 2026-06-06 13:15:54 -06:00
faq.md docs: improve SEO and GEO docs publishing (#2232) 2026-04-24 23:39:22 +02:00
index.md chore: update `mdformat` hook arguments to disable wrapping (#2307) 2026-06-09 16:15:05 +02:00
license.md
llms-100k.txt docs: improve SEO and GEO docs publishing (#2232) 2026-04-24 23:39:22 +02:00
llms.full.txt docs: improve SEO and GEO docs publishing (#2232) 2026-04-24 23:39:22 +02:00
llms.txt docs: improve SEO and GEO docs publishing (#2232) 2026-04-24 23:39:22 +02:00
robots.txt docs: improve SEO and GEO docs publishing (#2232) 2026-04-24 23:39:22 +02:00
trackers.md feat(docs): add GEO infrastructure for AI search visibility (#2224) 2026-04-21 11:40:44 +02:00