code: def __call__(self, imgs):
      img_augs = []
      for img in imgs:
          h, w = img.shape[:2]
          # later: provide list and randomly choose index for resize
          size = np.random.randint(
              self.short_edge_length[0], self.short_edge_length[1] + 1
          )
          if size == 0:
              return img
          scale = size * 1.0 / min(h, w)
          if h < w:
              newh, neww = size, scale * w
          else:
              newh, neww = scale * h, size
          if max(newh, neww) > self.max_size:
              scale = self.max_size * 1.0 / max(newh, neww)
              newh = newh * scale
              neww = neww * scale
          neww = int(neww + 0.5)
          newh = int(newh + 0.5)
  
          if img.dtype == np.uint8:
              pil_image = Image.fromarray(img)
              pil_image = pil_image.resize(
                  (neww, newh), PILImageResampling.BILINEAR
              )
              img = np.asarray(pil_image)
          else:
              img = img.permute(2, 0, 1).unsqueeze(
                  0
              )  # 3, 0, 1)  # hw(c) -> nchw
              img = nn.functional.interpolate(
                  img,
                  (newh, neww),
                  mode=self.interp_method,
                  align_corners=False,
              ).squeeze(0)
          img_augs.append(img)
  
      return img_augs
  
file_path: transformers/examples/research_projects/visual_bert/processing_image.py
imports: import sys
  from typing import Tuple
  import numpy
  import torch
  from PIL import Image
  from torch import nn
  from transformers.image_utils import PILImageResampling
  from utils import img_tensorize
label_desc: Use image node_id 2 for calling the ResizeShortestEdge obj's underlying member method code with example usage: obj.__call__(imgs) and returns: img_augs, img