code: def shrink_polygon_pyclipper(polygon, shrink_ratio):
      from shapely.geometry import Polygon
      import pyclipper
  
      polygon_shape = Polygon(polygon)
      distance = (
          polygon_shape.area
          * (1 - np.power(shrink_ratio, 2))
          / polygon_shape.length
      )
      subject = [tuple(l) for l in polygon]
      padding = pyclipper.PyclipperOffset()
      padding.AddPath(
          subject, pyclipper.JT_ROUND, pyclipper.ET_CLOSEDPOLYGON
      )
      shrinked = padding.Execute(-distance)
      if shrinked == []:
          shrinked = np.array(shrinked)
      else:
          shrinked = np.array(shrinked[0]).reshape(-1, 2)
      return shrinked
  
file_path: PaddleOCR/benchmark/PaddleOCR_DBNet/data_loader/modules/make_shrink_map.py
imports: import numpy
  import cv2
label_desc: Use image node_id 2 for calling a global function with example usage: shrink_polygon_pyclipper(polygon, shrink_ratio) and returns: shrinked