code: def assert_obj_detetion_result(
      gluon_ids,
      gluon_scores,
      gluon_boxes,
      onnx_ids,
      onnx_scores,
      onnx_boxes,
      score_thresh=0.6,
      score_tol=1e-4,
  ):
      def assert_bbox(gluon_box, onnx_box, box_tol=1e-2):
          def assert_scalar(a, b, tol=box_tol):
              return np.abs(a - b) <= tol
  
          return (
              assert_scalar(gluon_box[0], onnx_box[0])
              and assert_scalar(gluon_box[1], onnx_box[1])
              and assert_scalar(gluon_box[2], onnx_box[2])
              and assert_scalar(gluon_box[3], onnx_box[3])
          )
  
      found_match = False
      for i in range(len(onnx_ids)):
          onnx_id = onnx_ids[i][0]
          onnx_score = onnx_scores[i][0]
          onnx_box = onnx_boxes[i]
  
          if onnx_score < score_thresh:
              break
          for j in range(len(gluon_ids)):
              gluon_id = gluon_ids[j].asnumpy()[0]
              gluon_score = gluon_scores[j].asnumpy()[0]
              gluon_box = gluon_boxes[j].asnumpy()
              # check socre
              if onnx_score < gluon_score - score_tol:
                  continue
              if onnx_score > gluon_score + score_tol:
                  return False
              # check id
              if onnx_id != gluon_id:
                  continue
              # check bounding box
              if assert_bbox(gluon_box, onnx_box):
                  found_match = True
                  break
          if not found_match:
              return False
          found_match = False
      return True
  
file_path: gluon-cv/tests/onnx/test_inference.py
label_desc: Use image node_id 2 for calling a global function with example usage: assert_obj_detetion_result(gluon_ids, gluon_scores, gluon_boxes, onnx_ids, onnx_scores, onnx_boxes, score_thresh, score_tol) and returns: True, unknown, unknown, False, False