class_docstr: Constructs a DPT feature extractor.
  
  This feature extractor inherits from [`FeatureExtractionMixin`] which contains most of the main methods. Users
  should refer to this superclass for more information regarding those methods.
  
  Args:
      do_resize (`bool`, *optional*, defaults to `True`):
          Whether to resize the input to a certain `size`.
      size ('int' or `Tuple(int)`, *optional*, defaults to 384):
          Resize the input to the given size. If a tuple is provided, it should be (width, height). If only an
          integer is provided, then the input will be resized to (size, size). Only has an effect if `do_resize` is
          set to `True`.
      ensure_multiple_of (`int`, *optional*, defaults to 1):
          Ensure that the input is resized to a multiple of this value. Only has an effect if `do_resize` is set to
          `True`.
      keep_aspect_ratio (`bool`, *optional*, defaults to `False`):
          Whether to keep the aspect ratio of the input. Only has an effect if `do_resize` is set to `True`.
      resample (`int`, *optional*, defaults to `PIL.Image.Resampling.BILINEAR`):
          An optional resampling filter. This can be one of `PIL.Image.Resampling.NEAREST`,
          `PIL.Image.Resampling.BOX`, `PIL.Image.Resampling.BILINEAR`, `PIL.Image.Resampling.HAMMING`,
          `PIL.Image.Resampling.BICUBIC` or `PIL.Image.Resampling.LANCZOS`. Only has an effect if `do_resize` is set
          to `True`.
      do_normalize (`bool`, *optional*, defaults to `True`):
          Whether or not to normalize the input with mean and standard deviation.
      image_mean (`List[int]`, defaults to `[0.5, 0.5, 0.5]`):
          The sequence of means for each channel, to be used when normalizing images.
      image_std (`List[int]`, defaults to `[0.5, 0.5, 0.5]`):
          The sequence of standard deviations for each channel, to be used when normalizing images.
class_docstr_tok: ["Constructs","a","DPT","feature","extractor",".","This","feature","extractor","inherits","from","[","`","FeatureExtractionMixin","`","]","which","contains","most","of","the","main","methods",".","Users","should","refer","to","this","superclass","for","more","information","regarding","those","methods",".","Args",":","do_resize","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","resize","the","input","to","a","certain","`","size","`",".","size","(","'int","'","or","`","Tuple","(","int",")","`",",","*","optional","*",",","defaults","to","384",")",":","Resize","the","input","to","the","given","size",".","If","a","tuple","is","provided",",","it","should","be","(","width",",","height",")",".","If","only","an","integer","is","provided",",","then","the","input","will","be","resized","to","(","size",",","size",")",".","Only","has","an","effect","if","`","do_resize","`","is","set","to","`","True","`",".","ensure_multiple_of","(","`","int","`",",","*","optional","*",",","defaults","to","1",")",":","Ensure","that","the","input","is","resized","to","a","multiple","of","this","value",".","Only","has","an","effect","if","`","do_resize","`","is","set","to","`","True","`",".","keep_aspect_ratio","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Whether","to","keep","the","aspect","ratio","of","the","input",".","Only","has","an","effect","if","`","do_resize","`","is","set","to","`","True","`",".","resample","(","`","int","`",",","*","optional","*",",","defaults","to","`","PIL.Image.Resampling.BILINEAR","`",")",":","An","optional","resampling","filter",".","This","can","be","one","of","`","PIL.Image.Resampling.NEAREST","`",",","`","PIL.Image.Resampling.BOX","`",",","`","PIL.Image.Resampling.BILINEAR","`",",","`","PIL.Image.Resampling.HAMMING","`",",","`","PIL.Image.Resampling.BICUBIC","`","or","`","PIL.Image.Resampling.LANCZOS","`",".","Only","has","an","effect","if","`","do_resize","`","is","set","to","`","True","`",".","do_normalize","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","or","not","to","normalize","the","input","with","mean","and","standard","deviation",".","image_mean","(","`","List","[","int","]","`",",","defaults","to","`","[","0.5",",","0.5",",","0.5","]","`",")",":","The","sequence","of","means","for","each","channel",",","to","be","used","when","normalizing","images",".","image_std","(","`","List","[","int","]","`",",","defaults","to","`","[","0.5",",","0.5",",","0.5","]","`",")",":","The","sequence","of","standard","deviations","for","each","channel",",","to","be","used","when","normalizing","images","."]
code: def __init__(
      self,
      do_resize=True,
      size=384,
      keep_aspect_ratio=False,
      ensure_multiple_of=1,
      resample=PILImageResampling.BILINEAR,
      do_normalize=True,
      image_mean=None,
      image_std=None,
      **kwargs,
  ):
      super().__init__(**kwargs)
      self.do_resize = do_resize
      self.size = size
      self.keep_aspect_ratio = keep_aspect_ratio
      self.ensure_multiple_of = ensure_multiple_of
      self.resample = resample
      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: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/models/dpt/feature_extraction_dpt.py
imports: from typing import List, Optional, Tuple, Union
  import numpy
  from PIL import Image
  from transformers.image_utils import PILImageResampling
  from ...feature_extraction_utils import BatchFeature, FeatureExtractionMixin
  from ...image_utils import IMAGENET_STANDARD_MEAN, IMAGENET_STANDARD_STD, ImageFeatureExtractionMixin, ImageInput, is_torch_tensor
  from ...utils import TensorType, is_torch_available, logging
label_desc: Use image node_id 1 to create a new DPTFeatureExtractor object from inherited base classes: FeatureExtractionMixin, ImageFeatureExtractionMixin with example: obj = DPTFeatureExtractor(do_resize, size, keep_aspect_ratio, ensure_multiple_of, resample, do_normalize, image_mean, image_std)