class_docstr: Constructs a MobileViT 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": 224}`):
          Controls the size of the output image after resizing. Can be overridden by the `size` parameter in the
          `preprocess` method.
      resample (`PILImageResampling`, *optional*, defaults to `Resampling.BILINEAR`):
          Defines the resampling filter to use if resizing the image. 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. Can be overridden by the `rescale_factor` parameter in the
          `preprocess` method.
      do_center_crop (`bool`, *optional*, defaults to `True`):
          Whether to crop the input at the center. If the input size is smaller than `crop_size` along any edge, the
          image is padded with 0's and then center cropped. Can be overridden by the `do_center_crop` parameter in
          the `preprocess` method.
      crop_size (`Dict[str, int]`, *optional*, defaults to `{"height": 256, "width": 256}`):
          Desired output size `(size["height"], size["width"])` when applying center-cropping. Can be overridden by
          the `crop_size` parameter in the `preprocess` method.
      do_flip_channel_order (`bool`, *optional*, defaults to `True`):
          Whether to flip the color channels from RGB to BGR. Can be overridden by the `do_flip_channel_order`
          parameter in the `preprocess` method.
class_docstr_tok: ["Constructs","a","MobileViT","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","''",":","224","}","`",")",":","Controls","the","size","of","the","output","image","after","resizing",".","Can","be","overridden","by","the","`","size","`","parameter","in","the","`","preprocess","`","method",".","resample","(","`","PILImageResampling","`",",","*","optional","*",",","defaults","to","`","Resampling.BILINEAR","`",")",":","Defines","the","resampling","filter","to","use","if","resizing","the","image",".","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",".","Can","be","overridden","by","the","`","rescale_factor","`","parameter","in","the","`","preprocess","`","method",".","do_center_crop","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","crop","the","input","at","the","center",".","If","the","input","size","is","smaller","than","`","crop_size","`","along","any","edge",",","the","image","is","padded","with","0","'s","and","then","center","cropped",".","Can","be","overridden","by","the","`","do_center_crop","`","parameter","in","the","`","preprocess","`","method",".","crop_size","(","`","Dict","[","str",",","int","]","`",",","*","optional","*",",","defaults","to","`","{","``","height","''",":","256",",","``","width","''",":","256","}","`",")",":","Desired","output","size","`","(","size","[","``","height","''","]",",","size","[","``","width","''","]",")","`","when","applying","center-cropping",".","Can","be","overridden","by","the","`","crop_size","`","parameter","in","the","`","preprocess","`","method",".","do_flip_channel_order","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","flip","the","color","channels","from","RGB","to","BGR",".","Can","be","overridden","by","the","`","do_flip_channel_order","`","parameter","in","the","`","preprocess","`","method","."]
code: def _preprocess(
      self,
      image: ImageInput,
      do_resize: bool,
      do_rescale: bool,
      do_center_crop: bool,
      do_flip_channel_order: bool,
      size: Optional[Dict[str, int]] = None,
      resample: PILImageResampling = None,
      rescale_factor: Optional[float] = None,
      crop_size: Optional[Dict[str, int]] = None,
      input_data_format: Optional[Union[str, ChannelDimension]] = None,
  ):
      if do_resize:
          image = self.resize(
              image=image,
              size=size,
              resample=resample,
              input_data_format=input_data_format,
          )
  
      if do_rescale:
          image = self.rescale(
              image=image,
              scale=rescale_factor,
              input_data_format=input_data_format,
          )
  
      if do_center_crop:
          image = self.center_crop(
              image=image,
              size=crop_size,
              input_data_format=input_data_format,
          )
  
      if do_flip_channel_order:
          image = self.flip_channel_order(
              image, input_data_format=input_data_format
          )
  
      return image
  
file_path: transformers/src/transformers/models/mobilevit/image_processing_mobilevit.py
imports: from typing import Dict, List, Optional, Tuple, Union
  import numpy
  from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict
  from ...image_transforms import flip_channel_order, get_resize_output_image_size, resize, to_channel_dimension_format
  from ...image_utils import ChannelDimension, ImageInput, PILImageResampling, infer_channel_dimension_format, is_scaled_image, make_list_of_images, to_numpy_array, valid_images
  from ...utils import TensorType, is_torch_available, is_torch_tensor, is_vision_available, logging
label_desc: Use image node_id 5 for calling the MobileViTImageProcessor obj's underlying member method code with example usage: obj._preprocess(image, do_resize, do_rescale, do_center_crop, do_flip_channel_order, size, resample, rescale_factor, crop_size, input_data_format) and returns: image