class_docstr: Constructs a Vivit 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 `{"shortest_edge": 256}`):
          Size of the output image after resizing. The shortest edge of the image will be resized to
          `size["shortest_edge"]` while maintaining the aspect ratio of the original image. Can be overriden by
          `size` in the `preprocess` method.
      resample (`PILImageResampling`, *optional*, defaults to `Resampling.BILINEAR`):
          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 to center crop the image to the specified `crop_size`. Can be overridden by the `do_center_crop`
          parameter in the `preprocess` method.
      crop_size (`Dict[str, int]`, *optional*, defaults to `{"height": 224, "width": 224}`):
          Size of the image after applying the center crop. Can be overridden by the `crop_size` 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/127.5`):
          Defines the scale factor to use if rescaling the image. Can be overridden by the `rescale_factor` parameter
          in the `preprocess` method.
      offset (`bool`, *optional*, defaults to `True`):
          Whether to scale the image in both negative and positive directions. Can be overriden by the `offset` 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.
      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.
class_docstr_tok: ["Constructs","a","Vivit","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","`","{","``","shortest_edge","''",":","256","}","`",")",":","Size","of","the","output","image","after","resizing",".","The","shortest","edge","of","the","image","will","be","resized","to","`","size","[","``","shortest_edge","''","]","`","while","maintaining","the","aspect","ratio","of","the","original","image",".","Can","be","overriden","by","`","size","`","in","the","`","preprocess","`","method",".","resample","(","`","PILImageResampling","`",",","*","optional","*",",","defaults","to","`","Resampling.BILINEAR","`",")",":","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","to","center","crop","the","image","to","the","specified","`","crop_size","`",".","Can","be","overridden","by","the","`","do_center_crop","`","parameter","in","the","`","preprocess","`","method",".","crop_size","(","`","Dict","[","str",",","int","]","`",",","*","optional","*",",","defaults","to","`","{","``","height","''",":","224",",","``","width","''",":","224","}","`",")",":","Size","of","the","image","after","applying","the","center","crop",".","Can","be","overridden","by","the","`","crop_size","`","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\/127.5","`",")",":","Defines","the","scale","factor","to","use","if","rescaling","the","image",".","Can","be","overridden","by","the","`","rescale_factor","`","parameter","in","the","`","preprocess","`","method",".","offset","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","scale","the","image","in","both","negative","and","positive","directions",".","Can","be","overriden","by","the","`","offset","`","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",".","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","."]
code: def __init__(
      self,
      do_resize: bool = True,
      size: Dict[str, int] = None,
      resample: PILImageResampling = PILImageResampling.BILINEAR,
      do_center_crop: bool = True,
      crop_size: Dict[str, int] = None,
      do_rescale: bool = True,
      rescale_factor: Union[int, float] = 1 / 127.5,
      offset: bool = True,
      do_normalize: bool = True,
      image_mean: Optional[Union[float, List[float]]] = None,
      image_std: Optional[Union[float, List[float]]] = None,
      **kwargs,
  ) -> None:
      super().__init__(**kwargs)
      size = size if size is not None else {"shortest_edge": 256}
      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.do_center_crop = do_center_crop
      self.crop_size = crop_size
      self.resample = resample
      self.do_rescale = do_rescale
      self.rescale_factor = rescale_factor
      self.offset = offset
      self.do_normalize = do_normalize
      self.image_mean = (
          image_mean
          if image_mean is not None
          else IMAGENET_STANDARD_MEAN
      )
      self.image_std = (
          image_std if image_std is not None else IMAGENET_STANDARD_STD
      )
  
file_path: transformers/src/transformers/models/vivit/image_processing_vivit.py
imports: from typing import Dict, List, Optional, Union
  import numpy
  from transformers.utils import is_vision_available
  from transformers.utils.generic import TensorType
  from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict
  from ...image_transforms import get_resize_output_image_size, rescale, resize, to_channel_dimension_format
  from ...image_utils import IMAGENET_STANDARD_MEAN, IMAGENET_STANDARD_STD, ChannelDimension, ImageInput, PILImageResampling, infer_channel_dimension_format, is_scaled_image, is_valid_image, to_numpy_array, valid_images
  from ...utils import logging
label_desc: Use image node_id 1 to create a new VivitImageProcessor object from inherited base classes: BaseImageProcessor with example: obj = VivitImageProcessor(do_resize, size, resample, do_center_crop, crop_size, do_rescale, rescale_factor, offset, do_normalize, image_mean, image_std)