class_docstr: Constructs a DETR 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:
      format (`str`, *optional*, defaults to `"coco_detection"`):
          Data format of the annotations. One of "coco_detection" or "coco_panoptic".
      do_resize (`bool`, *optional*, defaults to `True`):
          Whether to resize the input to a certain `size`.
      size (`int`, *optional*, defaults to 800):
          Resize the input to the given size. Only has an effect if `do_resize` is set to `True`. If size is a
          sequence like `(width, height)`, output size will be matched to this. If size is an int, smaller edge of
          the image will be matched to this number. i.e, if `height > width`, then image will be rescaled to `(size *
          height / width, size)`.
      max_size (`int`, *optional*, defaults to 1333):
          The largest size an image dimension can have (otherwise it's capped). 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 (`int`, *optional*, defaults to `[0.485, 0.456, 0.406]`):
          The sequence of means for each channel, to be used when normalizing images. Defaults to the ImageNet mean.
      image_std (`int`, *optional*, defaults to `[0.229, 0.224, 0.225]`):
          The sequence of standard deviations for each channel, to be used when normalizing images. Defaults to the
          ImageNet std.
docstr: Pad images up to the largest image in a batch and create a corresponding `pixel_mask`.
  
  Args:
      pixel_values_list (`List[torch.Tensor]`):
          List of images (pixel values) to be padded. Each image should be a tensor of shape (C, H, W).
      return_tensors (`str` or [`~utils.TensorType`], *optional*):
          If set, will return tensors instead of NumPy arrays. If set to `'pt'`, return PyTorch `torch.Tensor`
          objects.
  
  Returns:
      [`BatchFeature`]: A [`BatchFeature`] with the following fields:
  
      - **pixel_values** -- Pixel values to be fed to a model.
      - **pixel_mask** -- Pixel mask to be fed to a model (when `pad_and_return_pixel_mask=True` or if
        *"pixel_mask"* is in `self.model_input_names`).
docstr_tok: ["Pad","images","up","to","the","largest","image","in","a","batch","and","create","a","corresponding","`","pixel_mask","`",".","Args",":","pixel_values_list","(","`","List","[","torch.Tensor","]","`",")",":","List","of","images","(","pixel","values",")","to","be","padded",".","Each","image","should","be","a","tensor","of","shape","(","C",",","H",",","W",")",".","return_tensors","(","`","str","`","or","[","`","~utils.TensorType","`","]",",","*","optional","*",")",":","If","set",",","will","return","tensors","instead","of","NumPy","arrays",".","If","set","to","`","'pt","'","`",",","return","PyTorch","`","torch.Tensor","`","objects",".","Returns",":","[","`","BatchFeature","`","]",":","A","[","`","BatchFeature","`","]","with","the","following","fields",":","-","*","*","pixel_values","*","*","--","Pixel","values","to","be","fed","to","a","model",".","-","*","*","pixel_mask","*","*","--","Pixel","mask","to","be","fed","to","a","model","(","when","`","pad_and_return_pixel_mask=True","`","or","if","*","''","pixel_mask","''","*","is","in","`","self.model_input_names","`",")","."]
code: def pad_and_create_pixel_mask(
      self,
      pixel_values_list: List["torch.Tensor"],
      return_tensors: Optional[Union[str, TensorType]] = None,
  ):
      """
      Pad images up to the largest image in a batch and create a corresponding `pixel_mask`.
  
      Args:
          pixel_values_list (`List[torch.Tensor]`):
              List of images (pixel values) to be padded. Each image should be a tensor of shape (C, H, W).
          return_tensors (`str` or [`~utils.TensorType`], *optional*):
              If set, will return tensors instead of NumPy arrays. If set to `'pt'`, return PyTorch `torch.Tensor`
              objects.
  
      Returns:
          [`BatchFeature`]: A [`BatchFeature`] with the following fields:
  
          - **pixel_values** -- Pixel values to be fed to a model.
          - **pixel_mask** -- Pixel mask to be fed to a model (when `pad_and_return_pixel_mask=True` or if
            *"pixel_mask"* is in `self.model_input_names`).
  
      """
  
      max_size = self._max_by_axis(
          [list(image.shape) for image in pixel_values_list]
      )
      c, h, w = max_size
      padded_images = []
      pixel_mask = []
      for image in pixel_values_list:
          # create padded image
          padded_image = np.zeros((c, h, w), dtype=np.float32)
          padded_image[
              : image.shape[0], : image.shape[1], : image.shape[2]
          ] = np.copy(image)
          padded_images.append(padded_image)
          # create pixel mask
          mask = np.zeros((h, w), dtype=np.int64)
          mask[: image.shape[1], : image.shape[2]] = True
          pixel_mask.append(mask)
  
      # return as BatchFeature
      data = {"pixel_values": padded_images, "pixel_mask": pixel_mask}
      encoded_inputs = BatchFeature(
          data=data, tensor_type=return_tensors
      )
  
      return encoded_inputs
  
imports: import io
  import pathlib
  import warnings
  from collections import defaultdict
  from typing import Dict, List, Optional, Set, Tuple, Union
  import numpy
  from PIL import Image
  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 11 for calling the DetrFeatureExtractor obj's underlying member method code with example usage: obj.pad_and_create_pixel_mask(pixel_values_list, return_tensors) and returns: encoded_inputs