code: def poly_iou(poly_det, poly_gt):
      """Calculate the IOU between two polygons.
  
      Args:
          poly_det (Polygon): A polygon predicted by detector.
          poly_gt (Polygon): A gt polygon.
  
      Returns:
          iou (float): The IOU between two polygons.
      """
      assert isinstance(poly_det, Polygon)
      assert isinstance(poly_gt, Polygon)
      area_inters, _ = poly_intersection(poly_det, poly_gt)
      area_union = poly_union(poly_det, poly_gt)
      if area_union == 0:
          return 0.0
      return area_inters / area_union
  
file_path: PaddleOCR/ppocr/utils/poly_nms.py
imports: import numpy
  from shapely.geometry import Polygon
label_desc: Use image node_id 6 for calling a global function with example usage: poly_iou(poly_det, poly_gt) and returns: unknown, int