class_docstr: Constructs a Swin2SR image processor.
  
  Args:
      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.
class_docstr_tok: ["Constructs","a","Swin2SR","image","processor",".","Args",":","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","."]
code: def __init__(
      self,
      do_rescale: bool = True,
      rescale_factor: Union[int, float] = 1 / 255,
      do_pad: bool = True,
      pad_size: int = 8,
      **kwargs,
  ) -> None:
      super().__init__(**kwargs)
  
      self.do_rescale = do_rescale
      self.rescale_factor = rescale_factor
      self.do_pad = do_pad
      self.pad_size = pad_size
  
file_path: transformers/src/transformers/models/swin2sr/image_processing_swin2sr.py
imports: from typing import Optional, Union
  import numpy
  from ...image_processing_utils import BaseImageProcessor, BatchFeature
  from ...image_transforms import get_image_size, pad, to_channel_dimension_format
  from ...image_utils import ChannelDimension, ImageInput, 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 Swin2SRImageProcessor object from inherited base classes: BaseImageProcessor with example: obj = Swin2SRImageProcessor(do_rescale, rescale_factor, do_pad, pad_size)