code: def matched_rbox_overlaps(anchors, gt_bboxes, use_cv2=False):
      """
  
      Args:
          anchors: [M, 5]  x1,y1,x2,y2,angle
          gt_bboxes: [M, 5]  x1,y1,x2,y2,angle
  
      Returns:
          macthed_iou: [M]
      """
      assert anchors.shape[1] == 5
      assert gt_bboxes.shape[1] == 5
  
      gt_bboxes_ploy = [rbox2poly_single(e) for e in gt_bboxes]
      anchors_ploy = [rbox2poly_single(e) for e in anchors]
  
      num = len(anchors_ploy)
      iou = np.zeros((num,), dtype=np.float64)
  
      start_time = time.time()
      for i in range(num):
          try:
              iou[i] = intersection(gt_bboxes_ploy[i], anchors_ploy[i])
          except Exception as e:
              print(
                  "cur gt_bboxes_ploy[i]",
                  gt_bboxes_ploy[i],
                  "anchors_ploy[j]",
                  anchors_ploy[i],
                  e,
              )
      return iou
  
file_path: PaddleDetection/ppdet/ext_op/unittest/test_matched_rbox_iou.py
imports: import numpy
  import sys
  import time
  from shapely.geometry import Polygon
  import paddle
  import unittest
  from ext_op import matched_rbox_iou
label_desc: Use image node_id 3 for calling a global function with example usage: matched_rbox_overlaps(anchors, gt_bboxes, use_cv2) and returns: iou