code: def crop_and_resize_image_tong(
      frames: tf.Tensor,
      resized_size: tuple[int, int] = (224, 224),
      scales: tf.Tensor = tf.constant([1, 0.875, 0.75, 0.66]),
  ) -> tf.Tensor:
      """Crops and resizes the images in the given sequence of images.
  
      Args:
        frames: A tensor of dimension [timesteps, input_h, input_w, channels].
        resized_size: The size for the resize operation.
        scales: The scales for the resize operation. Must be a tensor with 4 values.
      Returns:
        A tensor of shape [timesteps, output_h, output_w, channels] of same type as
        input with the cropped and resized images.
      """
  
      shape = tf.shape(input=frames)
      timesteps = shape[0]
      image_h = shape[1]
      image_w = shape[2]
      channels = shape[3]
  
      crop_h, crop_w, offset_h, offset_w = sample_crop_size(
          image_h=image_h,
          image_w=image_w,
          resized_size=resized_size,
          scales=scales,
      )
  
      offset = tf.convert_to_tensor(value=(0, offset_h, offset_w, 0))
      size = tf.convert_to_tensor(
          value=(timesteps, crop_h, crop_w, channels)
      )
      frames = tf.slice(frames, offset, size)
      frames = tf.image.resize(frames, resized_size)
  
      return frames
  
imports: from typing import Optional, Union
  from absl import logging
  from dmvr import builders
  from dmvr import processors
  import ml_collections
  import tensorflow
label_desc: Use image node_id 14 for calling a global function with example usage: crop_and_resize_image_tong(frames, resized_size, scales) and returns: frames