code: def rescale(img, bboxes, target_size=2240):
      h, w = img.shape[0:2]
      scale = target_size / max(h, w)
      img = cv2.resize(
          img,
          dsize=None,
          fx=scale,
          fy=scale,
          interpolation=cv2.INTER_CUBIC,
      )
      bboxes = bboxes * scale
      return img, bboxes
  
file_path: EasyOCR/trainer/craft/data/imgaug.py
imports: import random
  import cv2
  import numpy
  from PIL import Image
  from torchvision.transforms.functional import resized_crop, crop
  from torchvision.transforms import RandomResizedCrop, RandomCrop
  from torchvision.transforms import InterpolationMode
label_desc: Use image node_id 1 for calling a global function with example usage: rescale(img, bboxes, target_size) and returns: img,  bboxes