code: def get_max_height_width(
      images: List[np.ndarray],
      input_data_format: Optional[Union[str, ChannelDimension]] = None,
  ) -> List[int]:
      """
      Get the maximum height and width across all images in a batch.
      """
      if input_data_format is None:
          input_data_format = infer_channel_dimension_format(images[0])
  
      if input_data_format == ChannelDimension.FIRST:
          _, max_height, max_width = max_across_indices(
              [img.shape for img in images]
          )
      elif input_data_format == ChannelDimension.LAST:
          max_height, max_width, _ = max_across_indices(
              [img.shape for img in images]
          )
      else:
          raise ValueError(
              f"Invalid channel dimension format: {input_data_format}"
          )
      return (max_height, max_width)
  
imports: import json
  import os
  import warnings
  from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Union
  import numpy
  from huggingface_hub import hf_hub_download
  from huggingface_hub.utils import RepositoryNotFoundError
  from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict
  from ...image_transforms import PaddingMode, get_resize_output_image_size, pad, rescale, resize, to_channel_dimension_format
  from ...image_utils import ChannelDimension, ImageInput, PILImageResampling, get_image_size, infer_channel_dimension_format, is_scaled_image, make_list_of_images, to_numpy_array, valid_images
  from ...utils import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, TensorType, is_torch_available, is_torch_tensor, logging
label_desc: Use image node_id 2 for calling a global function with example usage: get_max_height_width(images, input_data_format) and returns: max_height,  max_width