code: def points2polygon(points):
      """Convert k points to 1 polygon.
  
      Args:
          points (ndarray or list): A ndarray or a list of shape (2k)
              that indicates k points.
  
      Returns:
          polygon (Polygon): A polygon object.
      """
      if isinstance(points, list):
          points = np.array(points)
  
      assert isinstance(points, np.ndarray)
      assert (points.size % 2 == 0) and (points.size >= 8)
  
      point_mat = points.reshape([-1, 2])
      return Polygon(point_mat)
  
file_path: PaddleOCR/ppocr/utils/poly_nms.py
imports: import numpy
  from shapely.geometry import Polygon
label_desc: Use image node_id 1 for calling a global function with example usage: points2polygon(points) and returns: Polygon