[Feature]: Geometry-aware dispatch to stop the recurring "silent AABB" bug class
Maintainers usually reply within 1 day
@Shehzad3684 is already working on this.
Since Jul 16, 2026.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- computer-vision
Research direction
Start by tracing Detections.area, with_nms/with_nmm, move_detections, and the as_yolo/as_coco/as_pascal_voc export paths mentioned in the issue. Compare how each selects mask, OBB, or box geometry, then define the incremental helper and contract-test boundaries; done means geometry-aware consumers are covered without per-detection loops or backward-incompatible data-model changes.
Written by the indexing model from the issue text.
Description
Search before asking
- I have searched the issues and discussions and found no similar feature request.
Feature Description
What: A small geometry-aware dispatch layer so detection ops use the geometry each detection actually carries (mask / OBB / box) instead of silently falling back to the axis-aligned xyxy.
Why: Several recent fixes are the same bug in different functions: code grabs detections.xyxy and forgets the real geometry lives in data["xyxyxyxy"] (OBB) or mask. Because xyxy is always present, the wrong answer is the silent default:
Detections.areareturned the AABB area, not the rotated body (#2306)with_nms/with_nmmdropped crossed OBBs via AABB IoU (#2303)as_yolodropped OBB rotation on export (#2289)roboflow/inference: consensus IoU, and stitch / crop corner shifts (https://github.com/roboflow/inference/pull/2420, https://github.com/roboflow/inference/pull/2427, https://github.com/roboflow/inference/pull/2430)
Same root cause each time: Detections holds several geometries at once and xyxy is just a derived envelope, so every consumer re-implements "which geometry is the real one?" and forgetting it fails silently. The next geometry-aware function will hit it again.
How: Centralize the dispatch into a few batched helpers and route call sites through them instead of reaching for xyxy. No data-model change, keeps the vectorized design, backward compatible. Migration can be incremental, then deprecate the ad-hoc paths.
Proposed helpers (batched, no per-detection loops):
detection_iou(a, b): dispatches mask / OBB / box IoUdetection_area(det): mask sum / shoelace / box areamove_detections(det, offset): shiftsxyxy,mask, OBB corners and keypoints together (what #2427 / #2430 each forgot)- a
test_op_respects_geometrycontract test that fails when an op can't tell an OBB from its envelope
Rollout can be incremental and each step is independent / backward compatible: (1) consolidate the duplicated move_detections (pure dedup, no behavior change), (2) the read-only detection_iou / detection_area dispatch, (3) the contract test.
A first pass suggests more call sites in the same class worth investigating: get_anchors_coordinates (and therefore LineZone / PolygonZone) reads anchors off the envelope rather than the rotated body, as_coco and as_pascal_voc have no is_obb option and drop the rotation on export, with_nmm merges to the union envelope while keeping one input's data["xyxyxyxy"], and DetectionsSmoother averages xyxy without smoothing the oriented corners.
Example Usage
# one dispatch per op, instead of every function re-deriving it
def detection_area(det):
if det.mask is not None: return det.mask.sum(axis=(1, 2))
if "xyxyxyxy" in det.data: return _shoelace(det.data["xyxyxyxy"])
return box_area(det.xyxy)
# same shape for detection_iou (mask / OBB / box), plus a geometry-complete
# move_detections that shifts every geometry field together (what #2427/#2430 forgot)
# and a contract test so the class is loud, not silent:
assert op(obb) != op(aabb_of(obb)) # an op must tell an OBB from its envelope
Are you willing to submit a PR?
- Yes I'd like to help by submitting a PR!
- Dominant language
- Python
- Stars
- 51.6k
- Forks
- 5k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 191
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from roboflow/supervision
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
roboflow/supervision#2971 ·
Maintainers usually reply within 1 day
-
[Bug]: DetectionDataset.split loses a train item when len(images) * split_ratio is a whole number (90 images at 0.7 give 62/28, not 63/27)Possibly taken @avanish-garg claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
roboflow/supervision#2968 ·
Maintainers usually reply within 1 day
-
[Bug]: MeanAverageRecall returns 0.0 instead of -1 when there are no targets (whole run or empty size bucket)Possibly taken @MaiAditya claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 20/100
roboflow/supervision#2964 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
roboflow/supervision#2950 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 56/100
roboflow/supervision#2938 · 2 comments ·
Maintainers usually reply within 1 day
All issues in roboflow/supervision
Similar issues
-
area:core-platform effort:S priority:P3 risk:night-safe status:ready type:test
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
randomparity/kdive#3620 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
FinanceFlash/unvibecode#760 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
google-research/google-research#3470 ·
Maintainers usually reply within 21 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
mrvautin/ha-workouts#11 ·