class_docstr: The post process for EAST.
class_docstr_tok: ["The","post","process","for","EAST","."]
docstr: Sort polygons.
docstr_tok: ["Sort","polygons","."]
code: def sort_poly(self, p):
      """
      Sort polygons.
      """
      min_axis = np.argmin(np.sum(p, axis=1))
      p = p[
          [
              min_axis,
              (min_axis + 1) % 4,
              (min_axis + 2) % 4,
              (min_axis + 3) % 4,
          ]
      ]
      if abs(p[0, 0] - p[1, 0]) > abs(p[0, 1] - p[1, 1]):
          return p
      else:
          return p[[0, 3, 2, 1]]
  
file_path: PaddleOCR/ppocr/postprocess/east_postprocess.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from .locality_aware_nms import nms_locality
  import cv2
  import paddle
  import os
  from ppocr.utils.utility import check_install
  import sys
label_desc: Use image node_id 4 for calling the EASTPostProcess obj's underlying member method code with example usage: obj.sort_poly(p) and returns: p, p