class_docstr: Constructs a Segformer image processor.
  
  Args:
      do_resize (`bool`, *optional*, defaults to `True`):
          Whether to resize the image's (height, width) dimensions to the specified `(size["height"],
          size["width"])`. Can be overridden by the `do_resize` parameter in the `preprocess` method.
      size (`Dict[str, int]` *optional*, defaults to `{"height": 512, "width": 512}`):
          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`):
          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`):
          Whether to normalize the image. Can be overridden by the `do_normalize` 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`):
          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.
      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","Segformer","image","processor",".","Args",":","do_resize","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","resize","the","image","'s","(","height",",","width",")","dimensions","to","the","specified","`","(","size","[","``","height","''","]",",","size","[","``","width","''","]",")","`",".","Can","be","overridden","by","the","`","do_resize","`","parameter","in","the","`","preprocess","`","method",".","size","(","`","Dict","[","str",",","int","]","`","*","optional","*",",","defaults","to","`","{","``","height","''",":","512",",","``","width","''",":","512","}","`",")",":","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","`",")",":","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","`",")",":","Whether","to","normalize","the","image",".","Can","be","overridden","by","the","`","do_normalize","`","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","`",")",":","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",".","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: Preprocesses a batch of images and optionally segmentation maps.
  
  Overrides the `__call__` method of the `Preprocessor` class so that both images and segmentation maps can be
  passed in as positional arguments.
docstr_tok: ["Preprocesses","a","batch","of","images","and","optionally","segmentation","maps",".","Overrides","the","`","__call__","`","method","of","the","`","Preprocessor","`","class","so","that","both","images","and","segmentation","maps","can","be","passed","in","as","positional","arguments","."]
code: def __call__(self, images, segmentation_maps=None, **kwargs):
      """
      Preprocesses a batch of images and optionally segmentation maps.
  
      Overrides the `__call__` method of the `Preprocessor` class so that both images and segmentation maps can be
      passed in as positional arguments.
      """
      return super().__call__(
          images, segmentation_maps=segmentation_maps, **kwargs
      )
  
file_path: transformers/src/transformers/models/segformer/image_processing_segformer.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_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, is_torch_available, is_torch_tensor, is_vision_available, logging
label_desc: Use image node_id 8 for calling the SegformerImageProcessor obj's underlying member method code with example usage: obj.__call__(images, segmentation_maps) and returns: super