class_docstr: Constructs a LeViT image processor.
  
  Args:
      do_resize (`bool`, *optional*, defaults to `True`):
          Wwhether to resize the shortest edge of the input to int(256/224 *`size`). Can be overridden by the
          `do_resize` parameter in the `preprocess` method.
      size (`Dict[str, int]`, *optional*, defaults to `{"shortest_edge": 224}`):
          Size of the output image after resizing. If size is a dict with keys "width" and "height", the image will
          be resized to `(size["height"], size["width"])`. If size is a dict with key "shortest_edge", the shortest
          edge value `c` is rescaled to `int(c * (256/224))`. The smaller edge of the image will be matched to this
          value i.e, if height > width, then image will be rescaled to `(size["shortest_egde"] * height / width,
          size["shortest_egde"])`. Can be overridden by the `size` parameter in the `preprocess` method.
      resample (`PILImageResampling`, *optional*, defaults to `Resampling.BICUBIC`):
          Resampling filter to use if resizing the image. Can be overridden by the `resample` parameter in the
          `preprocess` method.
      do_center_crop (`bool`, *optional*, defaults to `True`):
          Whether or not to center crop the input to `(crop_size["height"], crop_size["width"])`. Can be overridden
          by the `do_center_crop` parameter in the `preprocess` method.
      crop_size (`Dict`, *optional*, defaults to `{"height": 224, "width": 224}`):
          Desired image size after `center_crop`. Can be overridden by the `crop_size` parameter in the `preprocess`
          method.
      do_rescale (`bool`, *optional*, defaults to `True`):
          Controls 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. Can be overridden by the `rescale_factor` parameter in the
          `preprocess` method.
      do_normalize (`bool`, *optional*, defaults to `True`):
          Controls whether to normalize the image. Can be overridden by the `do_normalize` parameter in the
          `preprocess` method.
      image_mean (`List[int]`, *optional*, defaults to `[0.485, 0.456, 0.406]`):
          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 (`List[int]`, *optional*, defaults to `[0.229, 0.224, 0.225]`):
          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.
class_docstr_tok: ["Constructs","a","LeViT","image","processor",".","Args",":","do_resize","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Wwhether","to","resize","the","shortest","edge","of","the","input","to","int","(","256\/224","*","`","size","`",")",".","Can","be","overridden","by","the","`","do_resize","`","parameter","in","the","`","preprocess","`","method",".","size","(","`","Dict","[","str",",","int","]","`",",","*","optional","*",",","defaults","to","`","{","``","shortest_edge","''",":","224","}","`",")",":","Size","of","the","output","image","after","resizing",".","If","size","is","a","dict","with","keys","``","width","''","and","``","height","''",",","the","image","will","be","resized","to","`","(","size","[","``","height","''","]",",","size","[","``","width","''","]",")","`",".","If","size","is","a","dict","with","key","``","shortest_edge","''",",","the","shortest","edge","value","`","c","`","is","rescaled","to","`","int","(","c","*","(","256\/224",")",")","`",".","The","smaller","edge","of","the","image","will","be","matched","to","this","value","i.e",",","if","height",">","width",",","then","image","will","be","rescaled","to","`","(","size","[","``","shortest_egde","''","]","*","height","\/","width",",","size","[","``","shortest_egde","''","]",")","`",".","Can","be","overridden","by","the","`","size","`","parameter","in","the","`","preprocess","`","method",".","resample","(","`","PILImageResampling","`",",","*","optional","*",",","defaults","to","`","Resampling.BICUBIC","`",")",":","Resampling","filter","to","use","if","resizing","the","image",".","Can","be","overridden","by","the","`","resample","`","parameter","in","the","`","preprocess","`","method",".","do_center_crop","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","or","not","to","center","crop","the","input","to","`","(","crop_size","[","``","height","''","]",",","crop_size","[","``","width","''","]",")","`",".","Can","be","overridden","by","the","`","do_center_crop","`","parameter","in","the","`","preprocess","`","method",".","crop_size","(","`","Dict","`",",","*","optional","*",",","defaults","to","`","{","``","height","''",":","224",",","``","width","''",":","224","}","`",")",":","Desired","image","size","after","`","center_crop","`",".","Can","be","overridden","by","the","`","crop_size","`","parameter","in","the","`","preprocess","`","method",".","do_rescale","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Controls","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",".","Can","be","overridden","by","the","`","rescale_factor","`","parameter","in","the","`","preprocess","`","method",".","do_normalize","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Controls","whether","to","normalize","the","image",".","Can","be","overridden","by","the","`","do_normalize","`","parameter","in","the","`","preprocess","`","method",".","image_mean","(","`","List","[","int","]","`",",","*","optional","*",",","defaults","to","`","[","0.485",",","0.456",",","0.406","]","`",")",":","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","(","`","List","[","int","]","`",",","*","optional","*",",","defaults","to","`","[","0.229",",","0.224",",","0.225","]","`",")",":","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","."]
code: def __init__(
      self,
      do_resize: bool = True,
      size: Dict[str, int] = None,
      resample: PILImageResampling = PILImageResampling.BICUBIC,
      do_center_crop: bool = True,
      crop_size: Dict[str, int] = None,
      do_rescale: bool = True,
      rescale_factor: Union[int, float] = 1 / 255,
      do_normalize: bool = True,
      image_mean: Optional[
          Union[float, Iterable[float]]
      ] = IMAGENET_DEFAULT_MEAN,
      image_std: Optional[
          Union[float, Iterable[float]]
      ] = IMAGENET_DEFAULT_STD,
      **kwargs,
  ) -> None:
      super().__init__(**kwargs)
      size = size if size is not None else {"shortest_edge": 224}
      size = get_size_dict(size, default_to_square=False)
      crop_size = (
          crop_size
          if crop_size is not None
          else {"height": 224, "width": 224}
      )
      crop_size = get_size_dict(crop_size, param_name="crop_size")
  
      self.do_resize = do_resize
      self.size = size
      self.resample = resample
      self.do_center_crop = do_center_crop
      self.crop_size = crop_size
      self.do_rescale = do_rescale
      self.rescale_factor = rescale_factor
      self.do_normalize = do_normalize
      self.image_mean = (
          image_mean
          if image_mean is not None
          else IMAGENET_DEFAULT_MEAN
      )
      self.image_std = (
          image_std if image_std is not None else IMAGENET_DEFAULT_STD
      )
  
file_path: transformers/src/transformers/models/levit/image_processing_levit.py
imports: from typing import Dict, Iterable, Optional, Union
  import numpy
  from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict
  from ...image_transforms import get_resize_output_image_size, resize, to_channel_dimension_format
  from ...image_utils import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, ChannelDimension, ImageInput, PILImageResampling, 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 1 to create a new LevitImageProcessor object from inherited base classes: BaseImageProcessor with example: obj = LevitImageProcessor(do_resize, size, resample, do_center_crop, crop_size, do_rescale, rescale_factor, do_normalize, image_mean, image_std)