class_docstr: Constructs an ImageGPT feature extractor. This feature extractor can be used to resize images to a smaller
  resolution (such as 32x32 or 64x64), normalize them and finally color quantize them to obtain sequences of "pixel
  values" (color clusters).
  
  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:
      clusters (`np.ndarray`):
          The color clusters to use, as a `np.ndarray` of shape `(n_clusters, 3)`.
      do_resize (`bool`, *optional*, defaults to `True`):
          Whether to resize the input to a certain `size`.
      size (`int` or `Tuple(int)`, *optional*, defaults to 32):
          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`.
      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 to the range between -1 and +1.
code: def __init__(
      self,
      clusters,
      do_resize=True,
      size=32,
      resample=PILImageResampling.BILINEAR,
      do_normalize=True,
      **kwargs,
  ):
      super().__init__(**kwargs)
      self.clusters = np.asarray(clusters)
      self.do_resize = do_resize
      self.size = size
      self.resample = resample
      self.do_normalize = do_normalize
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/models/imagegpt/feature_extraction_imagegpt.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, logging
label_desc: Use image node_id 1 to create a new ImageGPTFeatureExtractor object from inherited base classes: FeatureExtractionMixin, ImageFeatureExtractionMixin with example: obj = ImageGPTFeatureExtractor(clusters, do_resize, size, resample, do_normalize)