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: Converts the output of [`DetrForObjectDetection`] into the format expected by the COCO api. Only supports
  PyTorch.
  
  Args:
      outputs ([`DetrObjectDetectionOutput`]):
          Raw outputs of the model.
      target_sizes (`torch.Tensor` of shape `(batch_size, 2)`):
          Tensor containing the size (height, width) of each image of the batch. For evaluation, this must be the
          original image size (before any data augmentation). For visualization, this should be the image size
          after data augment, but before padding.
  
  Returns:
      `List[Dict]`: A list of dictionaries, each dictionary containing the scores, labels and boxes for an image
      in the batch as predicted by the model.
docstr_tok: ["Converts","the","output","of","[","`","DetrForObjectDetection","`","]","into","the","format","expected","by","the","COCO","api",".","Only","supports","PyTorch",".","Args",":","outputs","(","[","`","DetrObjectDetectionOutput","`","]",")",":","Raw","outputs","of","the","model",".","target_sizes","(","`","torch.Tensor","`","of","shape","`","(","batch_size",",","2",")","`",")",":","Tensor","containing","the","size","(","height",",","width",")","of","each","image","of","the","batch",".","For","evaluation",",","this","must","be","the","original","image","size","(","before","any","data","augmentation",")",".","For","visualization",",","this","should","be","the","image","size","after","data","augment",",","but","before","padding",".","Returns",":","`","List","[","Dict","]","`",":","A","list","of","dictionaries",",","each","dictionary","containing","the","scores",",","labels","and","boxes","for","an","image","in","the","batch","as","predicted","by","the","model","."]
code: def post_process(self, outputs, target_sizes):
      """
      Converts the output of [`DetrForObjectDetection`] into the format expected by the COCO api. Only supports
      PyTorch.
  
      Args:
          outputs ([`DetrObjectDetectionOutput`]):
              Raw outputs of the model.
          target_sizes (`torch.Tensor` of shape `(batch_size, 2)`):
              Tensor containing the size (height, width) of each image of the batch. For evaluation, this must be the
              original image size (before any data augmentation). For visualization, this should be the image size
              after data augment, but before padding.
  
      Returns:
          `List[Dict]`: A list of dictionaries, each dictionary containing the scores, labels and boxes for an image
          in the batch as predicted by the model.
      """
      warnings.warn(
          "`post_process` is deprecated and will be removed in v5 of Transformers, please use"
          " `post_process_object_detection`",
          FutureWarning,
      )
  
      out_logits, out_bbox = outputs.logits, outputs.pred_boxes
  
      if len(out_logits) != len(target_sizes):
          raise ValueError(
              "Make sure that you pass in as many target sizes as the batch dimension of the logits"
          )
      if target_sizes.shape[1] != 2:
          raise ValueError(
              "Each element of target_sizes must contain the size (h, w) of each image of the batch"
          )
  
      prob = nn.functional.softmax(out_logits, -1)
      scores, labels = prob[..., :-1].max(-1)
  
      # convert to [x0, y0, x1, y1] format
      boxes = center_to_corners_format(out_bbox)
      # and from relative [0, 1] to absolute [0, height] coordinates
      img_h, img_w = target_sizes.unbind(1)
      scale_fct = torch.stack([img_w, img_h, img_w, img_h], dim=1)
      boxes = boxes * scale_fct[:, None, :]
  
      results = [
          {"scores": s, "labels": l, "boxes": b}
          for s, l, b in zip(scores, labels, boxes)
      ]
      return results
  
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 12 for calling the DetrFeatureExtractor obj's underlying member method code with example usage: obj.post_process(outputs, target_sizes) and returns: results