class_docstr: Constructs a ViT Hybrid 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
          `do_resize` in the `preprocess` method.
      size (`Dict[str, int]` *optional*, defaults to `{"shortest_edge": 224}`):
          Size of the image after resizing. The shortest edge of the image is resized to size["shortest_edge"], with
          the longest edge resized to keep the input aspect ratio. Can be overridden by `size` in the `preprocess`
          method.
      resample (`PILImageResampling`, *optional*, defaults to `PILImageResampling.BICUBIC`):
          Resampling filter to use if resizing the image. Can be overridden by `resample` in the `preprocess` method.
      do_center_crop (`bool`, *optional*, defaults to `True`):
          Whether to center crop the image to the specified `crop_size`. Can be overridden by `do_center_crop` in the
          `preprocess` method.
      crop_size (`Dict[str, int]` *optional*, defaults to 224):
          Size of the output image after applying `center_crop`. Can be overridden by `crop_size` 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 `do_rescale` in
          the `preprocess` method.
      rescale_factor (`int` or `float`, *optional*, defaults to `1/255`):
          Scale factor to use if rescaling the image. Can be overridden by `rescale_factor` in the `preprocess`
          method.
      do_normalize:
          Whether to normalize the image. Can be overridden by `do_normalize` 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.
      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_convert_rgb (`bool`, *optional*, defaults to `True`):
          Whether to convert the image to RGB.
class_docstr_tok: ["Constructs","a","ViT","Hybrid","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","`","do_resize","`","in","the","`","preprocess","`","method",".","size","(","`","Dict","[","str",",","int","]","`","*","optional","*",",","defaults","to","`","{","``","shortest_edge","''",":","224","}","`",")",":","Size","of","the","image","after","resizing",".","The","shortest","edge","of","the","image","is","resized","to","size","[","``","shortest_edge","''","]",",","with","the","longest","edge","resized","to","keep","the","input","aspect","ratio",".","Can","be","overridden","by","`","size","`","in","the","`","preprocess","`","method",".","resample","(","`","PILImageResampling","`",",","*","optional","*",",","defaults","to","`","PILImageResampling.BICUBIC","`",")",":","Resampling","filter","to","use","if","resizing","the","image",".","Can","be","overridden","by","`","resample","`","in","the","`","preprocess","`","method",".","do_center_crop","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","center","crop","the","image","to","the","specified","`","crop_size","`",".","Can","be","overridden","by","`","do_center_crop","`","in","the","`","preprocess","`","method",".","crop_size","(","`","Dict","[","str",",","int","]","`","*","optional","*",",","defaults","to","224",")",":","Size","of","the","output","image","after","applying","`","center_crop","`",".","Can","be","overridden","by","`","crop_size","`","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","`","do_rescale","`","in","the","`","preprocess","`","method",".","rescale_factor","(","`","int","`","or","`","float","`",",","*","optional","*",",","defaults","to","`","1\/255","`",")",":","Scale","factor","to","use","if","rescaling","the","image",".","Can","be","overridden","by","`","rescale_factor","`","in","the","`","preprocess","`","method",".","do_normalize",":","Whether","to","normalize","the","image",".","Can","be","overridden","by","`","do_normalize","`","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",".","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_convert_rgb","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","convert","the","image","to","RGB","."]
docstr: Resize an image. The shortest edge of the image is resized to size["shortest_edge"], with the longest edge
  resized to keep the input aspect ratio.
  
  Args:
      image (`np.ndarray`):
          Image to resize.
      size (`Dict[str, int]`):
          Size of the output image.
      resample (`PILImageResampling`, *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 (`ChannelDimension` or `str`, *optional*):
          The channel dimension format of the input image. If not provided, it will be inferred.
docstr_tok: ["Resize","an","image",".","The","shortest","edge","of","the","image","is","resized","to","size","[","``","shortest_edge","''","]",",","with","the","longest","edge","resized","to","keep","the","input","aspect","ratio",".","Args",":","image","(","`","np.ndarray","`",")",":","Image","to","resize",".","size","(","`","Dict","[","str",",","int","]","`",")",":","Size","of","the","output","image",".","resample","(","`","PILImageResampling","`",",","*","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","(","`","ChannelDimension","`","or","`","str","`",",","*","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],
      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. The shortest edge of the image is resized to size["shortest_edge"], with the longest edge
      resized to keep the input aspect ratio.
  
      Args:
          image (`np.ndarray`):
              Image to resize.
          size (`Dict[str, int]`):
              Size of the output image.
          resample (`PILImageResampling`, *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 (`ChannelDimension` or `str`, *optional*):
              The channel dimension format of the input image. If not provided, it will be inferred.
      """
      default_to_square = True
      if "shortest_edge" in size:
          size = size["shortest_edge"]
          default_to_square = False
      elif "height" in size and "width" in size:
          size = (size["height"], size["width"])
      else:
          raise ValueError(
              "Size must contain either 'shortest_edge' or 'height' and 'width'."
          )
  
      output_size = get_resize_output_image_size(
          image,
          size=size,
          default_to_square=default_to_square,
          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/vit_hybrid/image_processing_vit_hybrid.py
imports: from typing import Dict, List, Optional, Union
  import numpy
  from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict
  from ...image_transforms import convert_to_rgb, get_resize_output_image_size, resize, to_channel_dimension_format
  from ...image_utils import OPENAI_CLIP_MEAN, OPENAI_CLIP_STD, ChannelDimension, ImageInput, PILImageResampling, infer_channel_dimension_format, is_scaled_image, make_list_of_images, to_numpy_array, valid_images
  from ...utils import TensorType, is_vision_available, logging
label_desc: Use image node_id 2 for calling the ViTHybridImageProcessor obj's underlying member method code with example usage: obj.resize(image, size, resample, data_format, input_data_format) and returns: resize