code: def poly_nms(polygons, threshold):
      assert isinstance(polygons, list)
  
      polygons = np.array(sorted(polygons, key=lambda x: x[-1]))
  
      keep_poly = []
      index = [i for i in range(polygons.shape[0])]
  
      while len(index) > 0:
          keep_poly.append(polygons[index[-1]].tolist())
          A = polygons[index[-1]][:-1]
          index = np.delete(index, -1)
          iou_list = np.zeros((len(index),))
          for i in range(len(index)):
              B = polygons[index[i]][:-1]
              iou_list[i] = boundary_iou(A, B)
          remove_index = np.where(iou_list > threshold)
          index = np.delete(index, remove_index)
  
      return keep_poly
  
file_path: PaddleOCR/ppocr/utils/poly_nms.py
imports: import numpy
  from shapely.geometry import Polygon
label_desc: Use image node_id 7 for calling a global function with example usage: poly_nms(polygons, threshold) and returns: keep_poly