code: def random_resize_crop_synth(augment_targets, size):
      (
          image,
          region_score,
          affinity_score,
          confidence_mask,
      ) = augment_targets
  
      image = Image.fromarray(image)
      region_score = Image.fromarray(region_score)
      affinity_score = Image.fromarray(affinity_score)
      confidence_mask = Image.fromarray(confidence_mask)
  
      short_side = min(image.size)
      i, j, h, w = RandomCrop.get_params(
          image, output_size=(short_side, short_side)
      )
  
      image = resized_crop(
          image,
          i,
          j,
          h,
          w,
          size=(size, size),
          interpolation=InterpolationMode.BICUBIC,
      )
      region_score = resized_crop(
          region_score,
          i,
          j,
          h,
          w,
          (size, size),
          interpolation=InterpolationMode.BICUBIC,
      )
      affinity_score = resized_crop(
          affinity_score,
          i,
          j,
          h,
          w,
          (size, size),
          interpolation=InterpolationMode.BICUBIC,
      )
      confidence_mask = resized_crop(
          confidence_mask,
          i,
          j,
          h,
          w,
          (size, size),
          interpolation=InterpolationMode.NEAREST,
      )
  
      image = np.array(image)
      region_score = np.array(region_score)
      affinity_score = np.array(affinity_score)
      confidence_mask = np.array(confidence_mask)
      augment_targets = [
          image,
          region_score,
          affinity_score,
          confidence_mask,
      ]
  
      return augment_targets
  
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 2 for calling a global function with example usage: random_resize_crop_synth(augment_targets, size) and returns: augment_targets