code: def resize_images(
      frames: List[torch.Tensor], image_size: List[int]
  ) -> torch.Tensor:
      """
      Utils function to resize images
      """
      _image_max_image_pixels = Image.MAX_IMAGE_PIXELS
      Image.MAX_IMAGE_PIXELS = (
          None  # The dataset image is very large ...
      )
      images = torch.FloatTensor(frames) / 255.0
      Image.MAX_IMAGE_PIXELS = _image_max_image_pixels
  
      scale_factors = [
          s_new / s for s, s_new in zip(images.shape[1:3], image_size)
      ]
  
      if abs(scale_factors[0] - scale_factors[1]) > 1e-3:
          raise ValueError(
              "Non-isotropic scaling is not allowed. Consider changing the 'image_size' argument."
          )
      scale_factor = sum(scale_factors) * 0.5
  
      if scale_factor != 1.0:
          print(f"Rescaling dataset (factor={scale_factor})")
          images = torch.nn.functional.interpolate(
              images.permute(0, 3, 1, 2),
              size=tuple(image_size),
              mode="bilinear",
          ).permute(0, 2, 3, 1)
  
      return images
  
file_path: pytorchvideo/projects/video_nerf/dataset_utils.py
imports: import os
  import struct
  import sys
  from typing import List, Tuple
  import numpy
  import torch
  from objectron.schema import a_r_capture_metadata_pb2
  from PIL import Image
  from pytorch3d.transforms import Rotate, RotateAxisAngle, Translate
label_desc: Use image node_id 4 for calling a global function with example usage: resize_images(frames, image_size) and returns: images