code: def __call__(self, data):
      imgs = data["imgs"]
  
      h, w = imgs[0].shape[0:2]
      th, tw = self.size
      if w == tw and h == th:
          return imgs
  
      # label中存在文本实例，并且按照概率进行裁剪，使用threshold_label_map控制
      if np.max(imgs[2]) > 0 and random.random() > 3 / 8:
          # 文本实例的左上角点
          tl = np.min(np.where(imgs[2] > 0), axis=1) - self.size
          tl[tl < 0] = 0
          # 文本实例的右下角点
          br = np.max(np.where(imgs[2] > 0), axis=1) - self.size
          br[br < 0] = 0
          # 保证选到右下角点时，有足够的距离进行crop
          br[0] = min(br[0], h - th)
          br[1] = min(br[1], w - tw)
  
          for _ in range(50000):
              i = random.randint(tl[0], br[0])
              j = random.randint(tl[1], br[1])
              # 保证shrink_label_map有文本
              if imgs[1][i : i + th, j : j + tw].sum() <= 0:
                  continue
              else:
                  break
      else:
          i = random.randint(0, h - th)
          j = random.randint(0, w - tw)
  
      # return i, j, th, tw
      for idx in range(len(imgs)):
          if len(imgs[idx].shape) == 3:
              imgs[idx] = imgs[idx][i : i + th, j : j + tw, :]
          else:
              imgs[idx] = imgs[idx][i : i + th, j : j + tw]
      data["imgs"] = imgs
      return data
  
file_path: PaddleOCR/benchmark/PaddleOCR_DBNet/data_loader/modules/random_crop_data.py
imports: import random
  import cv2
  import numpy
label_desc: Use image node_id 2 for calling the PSERandomCrop obj's underlying member method code with example usage: obj.__call__(data) and returns: data, imgs