code: def random_sized_crop_img(
      im,
      size,
      jitter_scale=(0.08, 1.0),
      jitter_aspect=(3.0 / 4.0, 4.0 / 3.0),
      max_iter=10,
  ):
      """
      Performs Inception-style cropping (used for training).
      """
      assert (
          len(im.shape) == 3
      ), "Currently only support image for random_sized_crop"
      h, w = im.shape[1:3]
      i, j, h, w = _get_param_spatial_crop(
          scale=jitter_scale,
          ratio=jitter_aspect,
          height=h,
          width=w,
          num_repeat=max_iter,
          log_scale=False,
          switch_hw=True,
      )
      cropped = im[:, i : i + h, j : j + w]
      return torch.nn.functional.interpolate(
          cropped.unsqueeze(0),
          size=(size, size),
          mode="bilinear",
          align_corners=False,
      ).squeeze(0)
  
imports: import logging
  import math
  import numpy
  import random
  import torch
  import torchvision
  import torchvision.transforms.functional
  from PIL import Image, ImageFilter
  from scipy.ndimage import gaussian_filter
  from torchvision import transforms
  from .rand_augment import rand_augment_transform
  from .random_erasing import RandomErasing
label_desc: Use image node_id 20 for calling a global function with example usage: random_sized_crop_img(im, size, jitter_scale, jitter_aspect, max_iter) and returns: torch