Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/python-pytest/onnx/test_onnxruntime_cv.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ def obj_detection_test_images(tmpdir_factory):
'faster_rcnn_resnet101_v1d_coco',
'yolo3_darknet53_coco',
'yolo3_mobilenet1.0_coco',
'faster_rcnn_fpn_resnet50_v1b_coco',
'faster_rcnn_fpn_resnet101_v1d_coco',
'mask_rcnn_resnet18_v1b_coco',
'mask_rcnn_fpn_resnet18_v1b_coco',
'mask_rcnn_resnet50_v1b_coco',
Expand Down Expand Up @@ -315,6 +317,11 @@ def normalize_image(imgfile):
assert_obj_detetion_result(mx_class_ids[0], mx_scores[0], mx_boxes[0],
onnx_class_ids[0], onnx_scores[0], onnx_boxes[0],
score_thresh=0.8, score_tol=0.05, box_tol=15)
elif model.startswith('faster_rcnn_fpn'):
onnx_class_ids, onnx_scores, onnx_boxes = session.run([], {input_name: img_data.asnumpy()})
assert_obj_detetion_result(mx_class_ids[0], mx_scores[0], mx_boxes[0],
onnx_class_ids[0], onnx_scores[0], onnx_boxes[0],
score_thresh=0.8, score_tol=0.05, box_tol=30)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other object detection models are able to pass the test with box_tol=0.01, but here we loose it to box_tol=30 for faster_rcnn models. Do we know what causes the accuracy regression here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the onnx model can predict the same objects with very similar scores. It's just with a few boxes one of the four values (xstart, xend, ystart, yend) can differ by quit a bit (refer to the bbox of the boy in red). I am not sure about the cause, but it must be related to the fpn structure.

soccer_onnx)

soccer_mx

else:
onnx_class_ids, onnx_scores, onnx_boxes = session.run([], {input_name: img_data.asnumpy()})
assert_obj_detetion_result(mx_class_ids[0], mx_scores[0], mx_boxes[0],
Expand Down