code: def intersection_iog(g, p):
      """
      Intersection_iog.
      """
      g = Polygon(g[:8].reshape((4, 2)))
      p = Polygon(p[:8].reshape((4, 2)))
      if not g.is_valid or not p.is_valid:
          return 0
      inter = Polygon(g).intersection(Polygon(p)).area
      # union = g.area + p.area - inter
      union = p.area
      if union == 0:
          print("p_area is very small")
          return 0
      else:
          return inter / union
  
file_path: PaddleOCR/ppocr/postprocess/locality_aware_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: intersection_iog(g, p) and returns: int, int, unknown