class_docstr: Constructs a BEiT 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 `{"height": 256, "width": 256}`):
          Size of the output image after resizing. 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 to center crop the image. 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": 224, "width": 224}`):
          Desired output size when applying center-cropping. Only has an effect if `do_center_crop` is set to `True`.
          Can be overridden by the `crop_size` 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_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.
      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`):
          The mean to use if normalizing the image. This is a float or list of floats of length of the number of
          channels of 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`):
          The standard deviation to use if normalizing the image. This is a float or list of floats of length of the
          number of channels of the image. Can be overridden by the `image_std` parameter in the `preprocess` method.
      do_reduce_labels (`bool`, *optional*, defaults to `False`):
          Whether or not to reduce all label values of segmentation maps by 1. Usually used for datasets where 0 is
          used for background, and background itself is not included in all classes of a dataset (e.g. ADE20k). The
          background label will be replaced by 255. Can be overridden by the `do_reduce_labels` parameter in the
          `preprocess` method.
class_docstr_tok: ["Constructs","a","BEiT","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","`","{","``","height","''",":","256",",","``","width","''",":","256","}","`",")",":","Size","of","the","output","image","after","resizing",".","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","to","center","crop","the","image",".","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","''",":","224",",","``","width","''",":","224","}","`",")",":","Desired","output","size","when","applying","center-cropping",".","Only","has","an","effect","if","`","do_center_crop","`","is","set","to","`","True","`",".","Can","be","overridden","by","the","`","crop_size","`","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_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",".","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","`",")",":","The","mean","to","use","if","normalizing","the","image",".","This","is","a","float","or","list","of","floats","of","length","of","the","number","of","channels","of","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","`",")",":","The","standard","deviation","to","use","if","normalizing","the","image",".","This","is","a","float","or","list","of","floats","of","length","of","the","number","of","channels","of","the","image",".","Can","be","overridden","by","the","`","image_std","`","parameter","in","the","`","preprocess","`","method",".","do_reduce_labels","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Whether","or","not","to","reduce","all","label","values","of","segmentation","maps","by","1",".","Usually","used","for","datasets","where","0","is","used","for","background",",","and","background","itself","is","not","included","in","all","classes","of","a","dataset","(","e.g",".","ADE20k",")",".","The","background","label","will","be","replaced","by","255",".","Can","be","overridden","by","the","`","do_reduce_labels","`","parameter","in","the","`","preprocess","`","method","."]
docstr: Overrides the `from_dict` method from the base class to make sure `reduce_labels` is updated if image processor
  is created using from_dict and kwargs e.g. `BeitImageProcessor.from_pretrained(checkpoint, reduce_labels=True)`
docstr_tok: ["Overrides","the","`","from_dict","`","method","from","the","base","class","to","make","sure","`","reduce_labels","`","is","updated","if","image","processor","is","created","using","from_dict","and","kwargs","e.g",".","`","BeitImageProcessor.from_pretrained","(","checkpoint",",","reduce_labels=True",")","`"]
code: def from_dict(cls, image_processor_dict: Dict[str, Any], **kwargs):
      """
      Overrides the `from_dict` method from the base class to make sure `reduce_labels` is updated if image processor
      is created using from_dict and kwargs e.g. `BeitImageProcessor.from_pretrained(checkpoint, reduce_labels=True)`
      """
      image_processor_dict = image_processor_dict.copy()
      if "reduce_labels" in kwargs:
          image_processor_dict["reduce_labels"] = kwargs.pop(
              "reduce_labels"
          )
      return super().from_dict(image_processor_dict, **kwargs)
  
file_path: transformers/src/transformers/models/beit/image_processing_beit.py
imports: import warnings
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict
  from ...image_transforms import 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, 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 2 for calling the BeitImageProcessor obj's underlying member method code with example usage: obj.from_dict(cls, image_processor_dict) and returns: super