docstr: 从scales中随机选择一个尺度，对图片和文本框进行缩放
  :param data: {'img':,'text_polys':,'texts':,'ignore_tags':}
  :return:
docstr_tok: ["\u4ecescales\u4e2d\u968f\u673a\u9009\u62e9\u4e00\u4e2a\u5c3a\u5ea6\uff0c\u5bf9\u56fe\u7247\u548c\u6587\u672c\u6846\u8fdb\u884c\u7f29\u653e",":","param","data",":","{","'img","'",":",",'text_polys","'",":",",'texts","'",":",",'ignore_tags","'",":","}",":","return",":"]
code: def __call__(self, data: dict) -> dict:
      """
      从scales中随机选择一个尺度，对图片和文本框进行缩放
      :param data: {'img':,'text_polys':,'texts':,'ignore_tags':}
      :return:
      """
      im = data["img"]
      text_polys = data["text_polys"]
      ignore_tags = data["ignore_tags"]
      texts = data["texts"]
      all_care_polys = [
          text_polys[i] for i, tag in enumerate(ignore_tags) if not tag
      ]
      # 计算crop区域
      crop_x, crop_y, crop_w, crop_h = self.crop_area(
          im, all_care_polys
      )
      # crop 图片 保持比例填充
      scale_w = self.size[0] / crop_w
      scale_h = self.size[1] / crop_h
      scale = min(scale_w, scale_h)
      h = int(crop_h * scale)
      w = int(crop_w * scale)
      if self.keep_ratio:
          if len(im.shape) == 3:
              padimg = np.zeros(
                  (self.size[1], self.size[0], im.shape[2]), im.dtype
              )
          else:
              padimg = np.zeros((self.size[1], self.size[0]), im.dtype)
          padimg[:h, :w] = cv2.resize(
              im[crop_y : crop_y + crop_h, crop_x : crop_x + crop_w],
              (w, h),
          )
          img = padimg
      else:
          img = cv2.resize(
              im[crop_y : crop_y + crop_h, crop_x : crop_x + crop_w],
              tuple(self.size),
          )
      # crop 文本框
      text_polys_crop = []
      ignore_tags_crop = []
      texts_crop = []
      for poly, text, tag in zip(text_polys, texts, ignore_tags):
          poly = ((poly - (crop_x, crop_y)) * scale).tolist()
          if not self.is_poly_outside_rect(poly, 0, 0, w, h):
              text_polys_crop.append(poly)
              ignore_tags_crop.append(tag)
              texts_crop.append(text)
      data["img"] = img
      data["text_polys"] = np.float32(text_polys_crop)
      data["ignore_tags"] = ignore_tags_crop
      data["texts"] = texts_crop
      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 EastRandomCropData obj's underlying member method code with example usage: obj.__call__(data) and returns: data