Skip to content

Commit

Permalink
[Minor need to be in 1.5]Fix an issue in NMS test data which introduc…
Browse files Browse the repository at this point in the history
…e wrong shape. (onnx#1953)

* 1. Fix an issue in NMS test data which introduce wrong shape.
2. Add node test data for NMS

* Update docs

* update data type to int64 for output selected_indices in shape inference

* update format

* format
  • Loading branch information
HectorSVC authored and linkerzhang committed Apr 22, 2019
1 parent 9346dd5 commit 0e8d2bc
Show file tree
Hide file tree
Showing 67 changed files with 347 additions and 52 deletions.
31 changes: 14 additions & 17 deletions docs/Operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -8004,23 +8004,20 @@ node = onnx.helper.make_node(
inputs=['boxes', 'scores', 'max_output_boxes_per_class', 'iou_threshold', 'score_threshold'],
outputs=['selected_indices']
)
boxes = np.array([[
[0.0, 0.0, 1.0, 1.0],
[0.0, 0.1, 1.0, 1.1],
[0.0, -0.1, 1.0, 0.9],
[0.0, 10.0, 1.0, 11.0],
[0.0, 10.1, 1.0, 11.1],
[0.0, 100.0, 1.0, 101.0],

[0.0, 0.0, 1.0, 1.0],
[0.0, 0.1, 1.0, 1.1],
[0.0, -0.1, 1.0, 0.9],
[0.0, 10.0, 1.0, 11.0],
[0.0, 10.1, 1.0, 11.1],
[0.0, 100.0, 1.0, 101.0]
]]).astype(np.float32)
scores = np.array([[[0.9, 0.75, 0.6, 0.95, 0.5, 0.3],
[0.9, 0.75, 0.6, 0.95, 0.5, 0.3]]]).astype(np.float32)
boxes = np.array([[[0.0, 0.0, 1.0, 1.0],
[0.0, 0.1, 1.0, 1.1],
[0.0, -0.1, 1.0, 0.9],
[0.0, 10.0, 1.0, 11.0],
[0.0, 10.1, 1.0, 11.1],
[0.0, 100.0, 1.0, 101.0]],
[[0.0, 0.0, 1.0, 1.0],
[0.0, 0.1, 1.0, 1.1],
[0.0, -0.1, 1.0, 0.9],
[0.0, 10.0, 1.0, 11.0],
[0.0, 10.1, 1.0, 11.1],
[0.0, 100.0, 1.0, 101.0]]]).astype(np.float32)
scores = np.array([[[0.9, 0.75, 0.6, 0.95, 0.5, 0.3]],
[[0.9, 0.75, 0.6, 0.95, 0.5, 0.3]]]).astype(np.float32)
max_output_boxes_per_class = np.array([2]).astype(np.int64)
iou_threshold = np.array([0.5]).astype(np.float32)
score_threshold = np.array([0.0]).astype(np.float32)
Expand Down
31 changes: 14 additions & 17 deletions docs/TestCoverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4242,23 +4242,20 @@ node = onnx.helper.make_node(
inputs=['boxes', 'scores', 'max_output_boxes_per_class', 'iou_threshold', 'score_threshold'],
outputs=['selected_indices']
)
boxes = np.array([[
[0.0, 0.0, 1.0, 1.0],
[0.0, 0.1, 1.0, 1.1],
[0.0, -0.1, 1.0, 0.9],
[0.0, 10.0, 1.0, 11.0],
[0.0, 10.1, 1.0, 11.1],
[0.0, 100.0, 1.0, 101.0],

[0.0, 0.0, 1.0, 1.0],
[0.0, 0.1, 1.0, 1.1],
[0.0, -0.1, 1.0, 0.9],
[0.0, 10.0, 1.0, 11.0],
[0.0, 10.1, 1.0, 11.1],
[0.0, 100.0, 1.0, 101.0]
]]).astype(np.float32)
scores = np.array([[[0.9, 0.75, 0.6, 0.95, 0.5, 0.3],
[0.9, 0.75, 0.6, 0.95, 0.5, 0.3]]]).astype(np.float32)
boxes = np.array([[[0.0, 0.0, 1.0, 1.0],
[0.0, 0.1, 1.0, 1.1],
[0.0, -0.1, 1.0, 0.9],
[0.0, 10.0, 1.0, 11.0],
[0.0, 10.1, 1.0, 11.1],
[0.0, 100.0, 1.0, 101.0]],
[[0.0, 0.0, 1.0, 1.0],
[0.0, 0.1, 1.0, 1.1],
[0.0, -0.1, 1.0, 0.9],
[0.0, 10.0, 1.0, 11.0],
[0.0, 10.1, 1.0, 11.1],
[0.0, 100.0, 1.0, 101.0]]]).astype(np.float32)
scores = np.array([[[0.9, 0.75, 0.6, 0.95, 0.5, 0.3]],
[[0.9, 0.75, 0.6, 0.95, 0.5, 0.3]]]).astype(np.float32)
max_output_boxes_per_class = np.array([2]).astype(np.int64)
iou_threshold = np.array([0.5]).astype(np.float32)
score_threshold = np.array([0.0]).astype(np.float32)
Expand Down
31 changes: 14 additions & 17 deletions onnx/backend/test/case/node/nonmaxsuppression.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,23 +205,20 @@ def export_nonmaxsuppression_two_batches(): # type: () -> None
inputs=['boxes', 'scores', 'max_output_boxes_per_class', 'iou_threshold', 'score_threshold'],
outputs=['selected_indices']
)
boxes = np.array([[
[0.0, 0.0, 1.0, 1.0],
[0.0, 0.1, 1.0, 1.1],
[0.0, -0.1, 1.0, 0.9],
[0.0, 10.0, 1.0, 11.0],
[0.0, 10.1, 1.0, 11.1],
[0.0, 100.0, 1.0, 101.0],

[0.0, 0.0, 1.0, 1.0],
[0.0, 0.1, 1.0, 1.1],
[0.0, -0.1, 1.0, 0.9],
[0.0, 10.0, 1.0, 11.0],
[0.0, 10.1, 1.0, 11.1],
[0.0, 100.0, 1.0, 101.0]
]]).astype(np.float32)
scores = np.array([[[0.9, 0.75, 0.6, 0.95, 0.5, 0.3],
[0.9, 0.75, 0.6, 0.95, 0.5, 0.3]]]).astype(np.float32)
boxes = np.array([[[0.0, 0.0, 1.0, 1.0],
[0.0, 0.1, 1.0, 1.1],
[0.0, -0.1, 1.0, 0.9],
[0.0, 10.0, 1.0, 11.0],
[0.0, 10.1, 1.0, 11.1],
[0.0, 100.0, 1.0, 101.0]],
[[0.0, 0.0, 1.0, 1.0],
[0.0, 0.1, 1.0, 1.1],
[0.0, -0.1, 1.0, 0.9],
[0.0, 10.0, 1.0, 11.0],
[0.0, 10.1, 1.0, 11.1],
[0.0, 100.0, 1.0, 101.0]]]).astype(np.float32)
scores = np.array([[[0.9, 0.75, 0.6, 0.95, 0.5, 0.3]],
[[0.9, 0.75, 0.6, 0.95, 0.5, 0.3]]]).astype(np.float32)
max_output_boxes_per_class = np.array([2]).astype(np.int64)
iou_threshold = np.array([0.5]).astype(np.float32)
score_threshold = np.array([0.0]).astype(np.float32)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
 backend-test:�
�
boxes
scores
max_output_boxes_per_class
iou_threshold
score_thresholdselected_indices"NonMaxSuppression*
center_point_box�.test_nonmaxsuppression_center_point_box_formatZ
boxes



Z
scores



Z(
max_output_boxes_per_class


Z
iou_threshold


Z
score_threshold


b"
selected_indices


B
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
 backend-test:�
p
boxes
scores
max_output_boxes_per_class
iou_threshold
score_thresholdselected_indices"NonMaxSuppression*test_nonmaxsuppression_flipped_coordinatesZ
boxes



Z
scores



Z(
max_output_boxes_per_class


Z
iou_threshold


Z
score_threshold


b"
selected_indices


B
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
 backend-test:�
p
boxes
scores
max_output_boxes_per_class
iou_threshold
score_thresholdselected_indices"NonMaxSuppression&test_nonmaxsuppression_identical_boxesZ
boxes




Z
scores




Z(
max_output_boxes_per_class


Z
iou_threshold


Z
score_threshold


b"
selected_indices


B
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

BscoresJ(fff?fff?fff?fff?fff?fff?fff?fff?fff?fff?
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
 backend-test:�
p
boxes
scores
max_output_boxes_per_class
iou_threshold
score_thresholdselected_indices"NonMaxSuppression(test_nonmaxsuppression_limit_output_sizeZ
boxes



Z
scores



Z(
max_output_boxes_per_class


Z
iou_threshold


Z
score_threshold


b"
selected_indices


B
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
 backend-test:�
p
boxes
scores
max_output_boxes_per_class
iou_threshold
score_thresholdselected_indices"NonMaxSuppression!test_nonmaxsuppression_single_boxZ
boxes



Z
scores



Z(
max_output_boxes_per_class


Z
iou_threshold


Z
score_threshold


b"
selected_indices


B
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BscoresJfff?
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
 backend-test:�
p
boxes
scores
max_output_boxes_per_class
iou_threshold
score_thresholdselected_indices"NonMaxSuppression&test_nonmaxsuppression_suppress_by_IOUZ
boxes



Z
scores



Z(
max_output_boxes_per_class


Z
iou_threshold


Z
score_threshold


b"
selected_indices


B
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
 backend-test:�
p
boxes
scores
max_output_boxes_per_class
iou_threshold
score_thresholdselected_indices"NonMaxSuppression1test_nonmaxsuppression_suppress_by_IOU_and_scoresZ
boxes



Z
scores



Z(
max_output_boxes_per_class


Z
iou_threshold


Z
score_threshold


b"
selected_indices


B
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bscore_thresholdJ���>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
 backend-test:�
p
boxes
scores
max_output_boxes_per_class
iou_threshold
score_thresholdselected_indices"NonMaxSuppression"test_nonmaxsuppression_two_batchesZ
boxes



Z
scores



Z(
max_output_boxes_per_class


Z
iou_threshold


Z
score_threshold


b"
selected_indices


B
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 0e8d2bc

Please sign in to comment.