class_docstr: A GeneralizedRCNN with test-time augmentation enabled.
  Its :meth:`__call__` method has the same interface as :meth:`GeneralizedRCNN.forward`.
docstr: Args:
      input (dict): one dataset dict with "image" field being a CHW tensor
  
  Returns:
      dict: one output dict
docstr_tok: ["Args",":","input","(","dict",")",":","one","dataset","dict","with","``","image","''","field","being","a","CHW","tensor","Returns",":","dict",":","one","output","dict"]
code: def _inference_one_image(self, input):
      """
      Args:
          input (dict): one dataset dict with "image" field being a CHW tensor
  
      Returns:
          dict: one output dict
      """
      orig_shape = (input["height"], input["width"])
      augmented_inputs, tfms = self._get_augmented_inputs(input)
      # Detect boxes from all augmented versions
      with self._turn_off_roi_heads(["mask_on", "keypoint_on"]):
          # temporarily disable roi heads
          (
              all_boxes,
              all_scores,
              all_classes,
          ) = self._get_augmented_boxes(augmented_inputs, tfms)
      # merge all detected boxes to obtain final predictions for boxes
      merged_instances = self._merge_detections(
          all_boxes, all_scores, all_classes, orig_shape
      )
  
      if self.cfg.MODEL.MASK_ON:
          # Use the detected boxes to obtain masks
          augmented_instances = self._rescale_detected_boxes(
              augmented_inputs, merged_instances, tfms
          )
          # run forward on the detected boxes
          outputs = self._batch_inference(
              augmented_inputs, augmented_instances
          )
          # Delete now useless variables to avoid being out of memory
          del augmented_inputs, augmented_instances
          # average the predictions
          merged_instances.pred_masks = self._reduce_pred_masks(
              outputs, tfms
          )
          merged_instances = detector_postprocess(
              merged_instances, *orig_shape
          )
          return {"instances": merged_instances}
      else:
          return {"instances": merged_instances}
  
imports: import copy
  import numpy
  from contextlib import contextmanager
  from itertools import count
  from typing import List
  import torch
  from fvcore.transforms import HFlipTransform, NoOpTransform
  from torch import nn
  from torch.nn.parallel import DistributedDataParallel
  from detectron2.config import configurable
  from detectron2.data.detection_utils import read_image
  from detectron2.data.transforms import RandomFlip, ResizeShortestEdge, ResizeTransform, apply_augmentations
  from detectron2.structures import Boxes, Instances
  from .meta_arch import GeneralizedRCNN
  from .postprocessing import detector_postprocess
  from .roi_heads.fast_rcnn import fast_rcnn_inference_single_image
label_desc: Use image node_id 5 for calling the GeneralizedRCNNWithTTA obj's underlying member method code with example usage: obj._inference_one_image(input) and returns: dict, dict