class_docstr: Constructs a GLPN image processor.
  
  Args:
      do_resize (`bool`, *optional*, defaults to `True`):
          Whether to resize the image's (height, width) dimensions, rounding them down to the closest multiple of
          `size_divisor`. Can be overridden by `do_resize` in `preprocess`.
      size_divisor (`int`, *optional*, defaults to 32):
          When `do_resize` is `True`, images are resized so their height and width are rounded down to the closest
          multiple of `size_divisor`. Can be overridden by `size_divisor` in `preprocess`.
      resample (`PIL.Image` resampling filter, *optional*, defaults to `Resampling.BILINEAR`):
          Resampling filter to use if resizing the image. Can be overridden by `resample` in `preprocess`.
      do_rescale (`bool`, *optional*, defaults to `True`):
          Whether or not to apply the scaling factor (to make pixel values floats between 0. and 1.). Can be
          overridden by `do_rescale` in `preprocess`.
docstr: Resize the image, rounding the (height, width) dimensions down to the closest multiple of size_divisor.
  
  If the image is of dimension (3, 260, 170) and size_divisor is 32, the image will be resized to (3, 256, 160).
  
  Args:
      image (`np.ndarray`):
          The image to resize.
      size_divisor (`int`):
          The image is resized so its height and width are rounded down to the closest multiple of
          `size_divisor`.
      resample:
          `PIL.Image` resampling filter to use when resizing the image e.g. `PILImageResampling.BILINEAR`.
      data_format (`ChannelDimension` or `str`, *optional*):
          The channel dimension format for the output image. If `None`, the channel dimension format of the input
          image is used. Can be one of:
          - `ChannelDimension.FIRST`: image in (num_channels, height, width) format.
          - `ChannelDimension.LAST`: image in (height, width, num_channels) format.
      input_data_format (`ChannelDimension` or `str`, *optional*):
          The channel dimension format of the input image. If not set, the channel dimension format is inferred
          from the input image. Can be one of:
          - `"channels_first"` or `ChannelDimension.FIRST`: image in (num_channels, height, width) format.
          - `"channels_last"` or `ChannelDimension.LAST`: image in (height, width, num_channels) format.
  
  Returns:
      `np.ndarray`: The resized image.
code: def resize(
      self,
      image: np.ndarray,
      size_divisor: int,
      resample: PILImageResampling = PILImageResampling.BILINEAR,
      data_format: Optional[ChannelDimension] = None,
      input_data_format: Optional[Union[str, ChannelDimension]] = None,
      **kwargs,
  ) -> np.ndarray:
      """
      Resize the image, rounding the (height, width) dimensions down to the closest multiple of size_divisor.
  
      If the image is of dimension (3, 260, 170) and size_divisor is 32, the image will be resized to (3, 256, 160).
  
      Args:
          image (`np.ndarray`):
              The image to resize.
          size_divisor (`int`):
              The image is resized so its height and width are rounded down to the closest multiple of
              `size_divisor`.
          resample:
              `PIL.Image` resampling filter to use when resizing the image e.g. `PILImageResampling.BILINEAR`.
          data_format (`ChannelDimension` or `str`, *optional*):
              The channel dimension format for the output image. If `None`, the channel dimension format of the input
              image is used. Can be one of:
              - `ChannelDimension.FIRST`: image in (num_channels, height, width) format.
              - `ChannelDimension.LAST`: image in (height, width, num_channels) format.
          input_data_format (`ChannelDimension` or `str`, *optional*):
              The channel dimension format of the input image. If not set, the channel dimension format is inferred
              from the input image. Can be one of:
              - `"channels_first"` or `ChannelDimension.FIRST`: image in (num_channels, height, width) format.
              - `"channels_last"` or `ChannelDimension.LAST`: image in (height, width, num_channels) format.
  
      Returns:
          `np.ndarray`: The resized image.
      """
      height, width = get_image_size(
          image, channel_dim=input_data_format
      )
      # Rounds the height and width down to the closest multiple of size_divisor
      new_h = height // size_divisor * size_divisor
      new_w = width // size_divisor * size_divisor
      image = resize(
          image,
          (new_h, new_w),
          resample=resample,
          data_format=data_format,
          input_data_format=input_data_format,
          **kwargs,
      )
      return image
  
file_path: transformers/src/transformers/models/glpn/image_processing_glpn.py
imports: from typing import List, Optional, Union
  import numpy
  import PIL.Image
  from ...image_processing_utils import BaseImageProcessor, BatchFeature
  from ...image_transforms import resize, to_channel_dimension_format
  from ...image_utils import ChannelDimension, PILImageResampling, get_image_size, infer_channel_dimension_format, is_scaled_image, make_list_of_images, to_numpy_array, valid_images
  from ...utils import TensorType, logging
label_desc: Use image node_id 2 for calling the GLPNImageProcessor obj's underlying member method code with example usage: obj.resize(image, size_divisor, resample, data_format, input_data_format) and returns: image