class_docstr: Constructs a BridgeTower image processor.
  
  Args:
      do_resize (`bool`, *optional*, defaults to `True`):
          Whether to resize the image's (height, width) dimensions to the specified `size`. Can be overridden by the
          `do_resize` parameter in the `preprocess` method.
      size (`Dict[str, int]` *optional*, defaults to 288):
          Resize the shorter side of the input to `size["shortest_edge"]`. The longer side will be limited to under
          `int((1333 / 800) * size["shortest_edge"])` while preserving the aspect ratio. Only has an effect if
          `do_resize` is set to `True`. Can be overridden by the `size` parameter in the `preprocess` method.
      size_divisor (`int`, *optional*, defaults to 32):
          The size by which to make sure both the height and width can be divided. Only has an effect if `do_resize`
          is set to `True`. Can be overridden by the `size_divisor` parameter in the `preprocess` method.
      resample (`PILImageResampling`, *optional*, defaults to `Resampling.BICUBIC`):
          Resampling filter to use if resizing the image. Only has an effect if `do_resize` is set to `True`. Can be
          overridden by the `resample` parameter in the `preprocess` method.
      do_rescale (`bool`, *optional*, defaults to `True`):
          Whether to rescale the image by the specified scale `rescale_factor`. Can be overridden by the `do_rescale`
          parameter in the `preprocess` method.
      rescale_factor (`int` or `float`, *optional*, defaults to `1/255`):
          Scale factor to use if rescaling the image. Only has an effect if `do_rescale` is set to `True`. Can be
          overridden by the `rescale_factor` parameter in the `preprocess` method.
      do_normalize (`bool`, *optional*, defaults to `True`):
          Whether to normalize the image. Can be overridden by the `do_normalize` parameter in the `preprocess`
          method. Can be overridden by the `do_normalize` parameter in the `preprocess` method.
      image_mean (`float` or `List[float]`, *optional*, defaults to `IMAGENET_STANDARD_MEAN`):
          Mean to use if normalizing the image. This is a float or list of floats the length of the number of
          channels in the image. Can be overridden by the `image_mean` parameter in the `preprocess` method. Can be
          overridden by the `image_mean` parameter in the `preprocess` method.
      image_std (`float` or `List[float]`, *optional*, defaults to `IMAGENET_STANDARD_STD`):
          Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
          number of channels in the image. Can be overridden by the `image_std` parameter in the `preprocess` method.
          Can be overridden by the `image_std` parameter in the `preprocess` method.
      do_center_crop (`bool`, *optional*, defaults to `True`):
          Whether to center crop the image. Can be overridden by the `do_center_crop` parameter in the `preprocess`
          method.
      do_pad (`bool`, *optional*, defaults to `True`):
          Whether to pad the image to the `(max_height, max_width)` of the images in the batch. Can be overridden by
          the `do_pad` parameter in the `preprocess` method.
class_docstr_tok: ["Constructs","a","BridgeTower","image","processor",".","Args",":","do_resize","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","resize","the","image","'s","(","height",",","width",")","dimensions","to","the","specified","`","size","`",".","Can","be","overridden","by","the","`","do_resize","`","parameter","in","the","`","preprocess","`","method",".","size","(","`","Dict","[","str",",","int","]","`","*","optional","*",",","defaults","to","288",")",":","Resize","the","shorter","side","of","the","input","to","`","size","[","``","shortest_edge","''","]","`",".","The","longer","side","will","be","limited","to","under","`","int","(","(","1333","\/","800",")","*","size","[","``","shortest_edge","''","]",")","`","while","preserving","the","aspect","ratio",".","Only","has","an","effect","if","`","do_resize","`","is","set","to","`","True","`",".","Can","be","overridden","by","the","`","size","`","parameter","in","the","`","preprocess","`","method",".","size_divisor","(","`","int","`",",","*","optional","*",",","defaults","to","32",")",":","The","size","by","which","to","make","sure","both","the","height","and","width","can","be","divided",".","Only","has","an","effect","if","`","do_resize","`","is","set","to","`","True","`",".","Can","be","overridden","by","the","`","size_divisor","`","parameter","in","the","`","preprocess","`","method",".","resample","(","`","PILImageResampling","`",",","*","optional","*",",","defaults","to","`","Resampling.BICUBIC","`",")",":","Resampling","filter","to","use","if","resizing","the","image",".","Only","has","an","effect","if","`","do_resize","`","is","set","to","`","True","`",".","Can","be","overridden","by","the","`","resample","`","parameter","in","the","`","preprocess","`","method",".","do_rescale","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","rescale","the","image","by","the","specified","scale","`","rescale_factor","`",".","Can","be","overridden","by","the","`","do_rescale","`","parameter","in","the","`","preprocess","`","method",".","rescale_factor","(","`","int","`","or","`","float","`",",","*","optional","*",",","defaults","to","`","1\/255","`",")",":","Scale","factor","to","use","if","rescaling","the","image",".","Only","has","an","effect","if","`","do_rescale","`","is","set","to","`","True","`",".","Can","be","overridden","by","the","`","rescale_factor","`","parameter","in","the","`","preprocess","`","method",".","do_normalize","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","normalize","the","image",".","Can","be","overridden","by","the","`","do_normalize","`","parameter","in","the","`","preprocess","`","method",".","Can","be","overridden","by","the","`","do_normalize","`","parameter","in","the","`","preprocess","`","method",".","image_mean","(","`","float","`","or","`","List","[","float","]","`",",","*","optional","*",",","defaults","to","`","IMAGENET_STANDARD_MEAN","`",")",":","Mean","to","use","if","normalizing","the","image",".","This","is","a","float","or","list","of","floats","the","length","of","the","number","of","channels","in","the","image",".","Can","be","overridden","by","the","`","image_mean","`","parameter","in","the","`","preprocess","`","method",".","Can","be","overridden","by","the","`","image_mean","`","parameter","in","the","`","preprocess","`","method",".","image_std","(","`","float","`","or","`","List","[","float","]","`",",","*","optional","*",",","defaults","to","`","IMAGENET_STANDARD_STD","`",")",":","Standard","deviation","to","use","if","normalizing","the","image",".","This","is","a","float","or","list","of","floats","the","length","of","the","number","of","channels","in","the","image",".","Can","be","overridden","by","the","`","image_std","`","parameter","in","the","`","preprocess","`","method",".","Can","be","overridden","by","the","`","image_std","`","parameter","in","the","`","preprocess","`","method",".","do_center_crop","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","center","crop","the","image",".","Can","be","overridden","by","the","`","do_center_crop","`","parameter","in","the","`","preprocess","`","method",".","do_pad","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","pad","the","image","to","the","`","(","max_height",",","max_width",")","`","of","the","images","in","the","batch",".","Can","be","overridden","by","the","`","do_pad","`","parameter","in","the","`","preprocess","`","method","."]
docstr: Resize an image.
  
  Resizes the shorter side of the image to `size["shortest_edge"]` while preserving the aspect ratio. If the
  longer side is larger than the max size `(int(`size["shortest_edge"]` * 1333 / 800))`, the longer side is then
  resized to the max size while preserving the aspect ratio.
  
  Args:
      image (`np.ndarray`):
          Image to resize.
      size (`Dict[str, int]`):
          Controls the size of the output image. Should be of the form `{"shortest_edge": int}`.
      size_divisor (`int`, defaults to 32):
          The image is resized to a size that is a multiple of this value.
      resample (`PILImageResampling` filter, *optional*, defaults to `PILImageResampling.BICUBIC`):
          Resampling filter to use when resiizing the image.
      data_format (`str` or `ChannelDimension`, *optional*):
          The channel dimension format of the image. If not provided, it will be the same as the input image.
      input_data_format (`str` or `ChannelDimension`, *optional*):
          The channel dimension format of the input image. If not provided, it will be inferred.
docstr_tok: ["Resize","an","image",".","Resizes","the","shorter","side","of","the","image","to","`","size","[","``","shortest_edge","''","]","`","while","preserving","the","aspect","ratio",".","If","the","longer","side","is","larger","than","the","max","size","`","(","int","(","`","size","[","``","shortest_edge","''","]","`","*","1333","\/","800",")",")","`",",","the","longer","side","is","then","resized","to","the","max","size","while","preserving","the","aspect","ratio",".","Args",":","image","(","`","np.ndarray","`",")",":","Image","to","resize",".","size","(","`","Dict","[","str",",","int","]","`",")",":","Controls","the","size","of","the","output","image",".","Should","be","of","the","form","`","{","``","shortest_edge","''",":","int","}","`",".","size_divisor","(","`","int","`",",","defaults","to","32",")",":","The","image","is","resized","to","a","size","that","is","a","multiple","of","this","value",".","resample","(","`","PILImageResampling","`","filter",",","*","optional","*",",","defaults","to","`","PILImageResampling.BICUBIC","`",")",":","Resampling","filter","to","use","when","resiizing","the","image",".","data_format","(","`","str","`","or","`","ChannelDimension","`",",","*","optional","*",")",":","The","channel","dimension","format","of","the","image",".","If","not","provided",",","it","will","be","the","same","as","the","input","image",".","input_data_format","(","`","str","`","or","`","ChannelDimension","`",",","*","optional","*",")",":","The","channel","dimension","format","of","the","input","image",".","If","not","provided",",","it","will","be","inferred","."]
code: def resize(
      self,
      image: np.ndarray,
      size: Dict[str, int],
      size_divisor: int = 32,
      resample: PILImageResampling = PILImageResampling.BICUBIC,
      data_format: Optional[Union[str, ChannelDimension]] = None,
      input_data_format: Optional[Union[str, ChannelDimension]] = None,
      **kwargs,
  ) -> np.ndarray:
      """
      Resize an image.
  
      Resizes the shorter side of the image to `size["shortest_edge"]` while preserving the aspect ratio. If the
      longer side is larger than the max size `(int(`size["shortest_edge"]` * 1333 / 800))`, the longer side is then
      resized to the max size while preserving the aspect ratio.
  
      Args:
          image (`np.ndarray`):
              Image to resize.
          size (`Dict[str, int]`):
              Controls the size of the output image. Should be of the form `{"shortest_edge": int}`.
          size_divisor (`int`, defaults to 32):
              The image is resized to a size that is a multiple of this value.
          resample (`PILImageResampling` filter, *optional*, defaults to `PILImageResampling.BICUBIC`):
              Resampling filter to use when resiizing the image.
          data_format (`str` or `ChannelDimension`, *optional*):
              The channel dimension format of the image. If not provided, it will be the same as the input image.
          input_data_format (`str` or `ChannelDimension`, *optional*):
              The channel dimension format of the input image. If not provided, it will be inferred.
      """
      size = get_size_dict(size, default_to_square=False)
      if "shortest_edge" not in size:
          raise ValueError(
              f"The `size` dictionary must contain the key `shortest_edge`. Got {size.keys()}"
          )
      shorter = size["shortest_edge"]
      longer = int(1333 / 800 * shorter)
      output_size = get_resize_output_image_size(
          image,
          shorter=shorter,
          longer=longer,
          size_divisor=size_divisor,
          input_data_format=input_data_format,
      )
      return resize(
          image,
          size=output_size,
          resample=resample,
          data_format=data_format,
          input_data_format=input_data_format,
          **kwargs,
      )
  
file_path: transformers/src/transformers/models/bridgetower/image_processing_bridgetower.py
imports: from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
  import numpy
  from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict
  from ...image_transforms import PaddingMode, center_crop, pad, resize, to_channel_dimension_format
  from ...image_utils import OPENAI_CLIP_MEAN, OPENAI_CLIP_STD, ChannelDimension, ImageInput, PILImageResampling, get_image_size, infer_channel_dimension_format, is_batched, is_scaled_image, to_numpy_array, valid_images
  from ...utils import TensorType, is_vision_available, logging
label_desc: Use image node_id 2 for calling the BridgeTowerImageProcessor obj's underlying member method code with example usage: obj.resize(image, size, size_divisor, resample, data_format, input_data_format) and returns: resize