class_docstr: Generalized R-CNN. Any models that contains the following three components:
  1. Per-image feature extraction (aka backbone)
  2. Region proposal generation
  3. Per-region feature extraction and prediction
class_docstr_tok: ["Generalized","R-CNN",".","Any","models","that","contains","the","following","three","components",":","1",".","Per-image","feature","extraction","(","aka","backbone",")","2",".","Region","proposal","generation","3",".","Per-region","feature","extraction","and","prediction"]
docstr: Rescale the output instances to the target size.
docstr_tok: ["Rescale","the","output","instances","to","the","target","size","."]
code: def _postprocess(
      instances,
      batched_inputs: List[Dict[str, torch.Tensor]],
      image_sizes,
  ):
      """
      Rescale the output instances to the target size.
      """
      # note: private function; subject to changes
      processed_results = []
      for results_per_image, input_per_image, image_size in zip(
          instances, batched_inputs, image_sizes
      ):
          height = input_per_image.get("height", image_size[0])
          width = input_per_image.get("width", image_size[1])
          r = detector_postprocess(results_per_image, height, width)
          processed_results.append({"instances": r})
      return processed_results
  
imports: import logging
  import numpy
  from typing import Dict, List, Optional, Tuple
  import torch
  from torch import nn
  from detectron2.config import configurable
  from detectron2.data.detection_utils import convert_image_to_rgb
  from detectron2.layers import move_device_like
  from detectron2.structures import ImageList, Instances
  from detectron2.utils.events import get_event_storage
  from detectron2.utils.logger import log_first_n
  from ..backbone import Backbone, build_backbone
  from ..postprocessing import detector_postprocess
  from ..proposal_generator import build_proposal_generator
  from ..roi_heads import build_roi_heads
  from .build import META_ARCH_REGISTRY
label_desc: Use image node_id 9 for calling the GeneralizedRCNN obj's underlying member method code with example usage: obj._postprocess(instances, batched_inputs, image_sizes) and returns: processed_results