class_docstr: Constructs an OWL-ViT 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 shorter edge of the input to a certain `size`.
      size (`int` or `Tuple[int, int]`, *optional*, defaults to (768, 768)):
          The size to use for resizing the image. Only has an effect if `do_resize` is set to `True`. If `size` is a
          sequence like (h, w), output size will be matched to this. If `size` is an int, then image will be resized
          to (size, size).
      resample (`int`, *optional*, defaults to `PIL.Image.Resampling.BICUBIC`):
          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_center_crop (`bool`, *optional*, defaults to `False`):
          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.
      crop_size (`int`, *optional*, defaults to 768):
      do_normalize (`bool`, *optional*, defaults to `True`):
          Whether or not to normalize the input with `image_mean` and `image_std`. Desired output size when applying
          center-cropping. Only has an effect if `do_center_crop` is set to `True`.
      image_mean (`List[int]`, *optional*, defaults to `[0.48145466, 0.4578275, 0.40821073]`):
          The sequence of means for each channel, to be used when normalizing images.
      image_std (`List[int]`, *optional*, defaults to `[0.26862954, 0.26130258, 0.27577711]`):
          The sequence of standard deviations for each channel, to be used when normalizing images.
code: def __init__(
      self,
      do_resize=True,
      size=(768, 768),
      resample=PILImageResampling.BICUBIC,
      crop_size=768,
      do_center_crop=False,
      do_normalize=True,
      image_mean=None,
      image_std=None,
      **kwargs,
  ):
      # Early versions of the OWL-ViT config on the hub had "rescale" as a flag. This clashes with the
      # vision feature extractor method `rescale` as it would be set as an attribute during the super().__init__
      # call. This is for backwards compatibility.
      if "rescale" in kwargs:
          rescale_val = kwargs.pop("rescale")
          kwargs["do_rescale"] = rescale_val
  
      super().__init__(**kwargs)
      self.size = size
      self.resample = resample
      self.crop_size = crop_size
      self.do_resize = do_resize
      self.do_center_crop = do_center_crop
      self.do_normalize = do_normalize
      self.image_mean = (
          image_mean
          if image_mean is not None
          else [0.48145466, 0.4578275, 0.40821073]
      )
      self.image_std = (
          image_std
          if image_std is not None
          else [0.26862954, 0.26130258, 0.27577711]
      )
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/models/owlvit/feature_extraction_owlvit.py
imports: from typing import List, Optional, Union
  import numpy
  from PIL import Image
  from transformers.image_utils import PILImageResampling
  from ...feature_extraction_utils import BatchFeature, FeatureExtractionMixin
  from ...image_utils import ImageFeatureExtractionMixin, is_torch_tensor
  from ...utils import TensorType, is_torch_available, logging
label_desc: Use image node_id 1 to create a new OwlViTFeatureExtractor object from inherited base classes: FeatureExtractionMixin, ImageFeatureExtractionMixin with example: obj = OwlViTFeatureExtractor(do_resize, size, resample, crop_size, do_center_crop, do_normalize, image_mean, image_std)