docstr: rotate image with 90 / 180 / 270 degre
docstr_tok: ["rotate","image","with","90","\/","180","\/","270","degre"]
code: def rotate_im_poly(self, im, text_polys):
      """
      rotate image with 90 / 180 / 270 degre
      """
      im_w, im_h = im.shape[1], im.shape[0]
      dst_im = im.copy()
      dst_polys = []
      rand_degree_ratio = np.random.rand()
      rand_degree_cnt = 1
      if rand_degree_ratio > 0.5:
          rand_degree_cnt = 3
      for i in range(rand_degree_cnt):
          dst_im = np.rot90(dst_im)
      rot_degree = -90 * rand_degree_cnt
      rot_angle = rot_degree * math.pi / 180.0
      n_poly = text_polys.shape[0]
      cx, cy = 0.5 * im_w, 0.5 * im_h
      ncx, ncy = 0.5 * dst_im.shape[1], 0.5 * dst_im.shape[0]
      for i in range(n_poly):
          wordBB = text_polys[i]
          poly = []
          for j in range(4):  # 16->4
              sx, sy = wordBB[j][0], wordBB[j][1]
              dx = (
                  math.cos(rot_angle) * (sx - cx)
                  - math.sin(rot_angle) * (sy - cy)
                  + ncx
              )
              dy = (
                  math.sin(rot_angle) * (sx - cx)
                  + math.cos(rot_angle) * (sy - cy)
                  + ncy
              )
              poly.append([dx, dy])
          dst_polys.append(poly)
      return dst_im, np.array(dst_polys, dtype=np.float32)
  
imports: import math
  import cv2
  import numpy
  from skimage.morphology._skeletonize import thin
  from ppocr.utils.e2e_utils.extract_textpoint_fast import sort_and_expand_with_direction_v2
label_desc: Use image node_id 26 for calling the PGProcessTrain obj's underlying member method code with example usage: obj.rotate_im_poly(im, text_polys) and returns: dst_im,  np