Repository navigation
Conversation
Author
|
The only cpu/pr-head failure is |
The all-class NMS loop used "IoU >= threshold" when invalidating boxes, so a box whose IoU equals the threshold was dropped. ONNX NonMaxSuppression keeps boxes at equality (only a strictly greater overlap suppresses), which made imported NMS results miss boundary boxes. Use a strict greater-than comparison and add an ONNX Runtime checked regression test for the equality case.
173787247
force-pushed
the
fix/onnx-nms-strict-iou
branch
from
October 29, 2026 01:48
a6a86a8 to
d783c2e
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #20840
Problem
The all-class NMS loop invalidated a box when
IoU >= iou_threshold. ONNXNonMaxSuppressionsuppresses only boxes whose IoU is strictly greater than the threshold, so a box at exactly the threshold was dropped.The reported example: boxes with IoU exactly
0.5, threshold0.5[[0, 0, 0], [0, 0, 1]][[0, 0, 0]]Change
_nms_loopnow usesiou > iou_thresholdfor the all-class NMS path (the classic NMS loop and the Python reference implementation keep their historical>=behavior).test_nms_iou_equal_threshold, checked against ONNX Runtime for the equality boundary and the neighbouring0.49case.Validation
pytest tests/python/relax/test_frontend_onnx.py -k nmspasses (4 tests), and the reported input now selects both boxes at threshold0.5.