code: def poly_intersection(poly_det, poly_gt, buffer=0.0001):
      """Calculate the intersection area between two polygon.
  
      Args:
          poly_det (Polygon): A polygon predicted by detector.
          poly_gt (Polygon): A gt polygon.
  
      Returns:
          intersection_area (float): The intersection area between two polygons.
      """
      assert isinstance(poly_det, Polygon)
      assert isinstance(poly_gt, Polygon)
  
      if buffer == 0:
          poly_inter = poly_det & poly_gt
      else:
          poly_inter = poly_det.buffer(buffer) & poly_gt.buffer(buffer)
      return poly_inter.area, poly_inter
  
file_path: PaddleOCR/ppocr/utils/poly_nms.py
imports: import numpy
  from shapely.geometry import Polygon
label_desc: Use image node_id 2 for calling a global function with example usage: poly_intersection(poly_det, poly_gt, buffer) and returns: poly_inter,  poly_inter