class_docstr: Create a simple end-to-end predictor with the given config that runs on
  single device for a single input image.
  
  Compared to using the model directly, this class does the following additions:
  
  1. Load checkpoint from `cfg.MODEL.WEIGHTS`.
  2. Always take BGR image as the input and apply conversion defined by `cfg.INPUT.FORMAT`.
  3. Apply resizing defined by `cfg.INPUT.{MIN,MAX}_SIZE_TEST`.
  4. Take one input image and produce a single output, instead of a batch.
  
  This is meant for simple demo purposes, so it does the above steps automatically.
  This is not meant for benchmarks or running complicated inference logic.
  If you'd like to do anything more complicated, please refer to its source code as
  examples to build and use the model manually.
  
  Attributes:
      metadata (Metadata): the metadata of the underlying dataset, obtained from
          cfg.DATASETS.TEST.
  
  Examples:
  ::
      pred = DefaultPredictor(cfg)
      inputs = cv2.imread("input.jpg")
      outputs = pred(inputs)
docstr: Args:
      original_image (np.ndarray): an image of shape (H, W, C) (in BGR order).
  
  Returns:
      predictions (dict):
          the output of the model for one image only.
          See :doc:`/tutorials/models` for details about the format.
docstr_tok: ["Args",":","original_image","(","np.ndarray",")",":","an","image","of","shape","(","H",",","W",",","C",")","(","in","BGR","order",")",".","Returns",":","predictions","(","dict",")",":","the","output","of","the","model","for","one","image","only",".","See",":","doc",":","`","\/tutorials\/models","`","for","details","about","the","format","."]
code: def __call__(self, original_image):
      """
      Args:
          original_image (np.ndarray): an image of shape (H, W, C) (in BGR order).
  
      Returns:
          predictions (dict):
              the output of the model for one image only.
              See :doc:`/tutorials/models` for details about the format.
      """
      with torch.no_grad():  # https://github.com/sphinx-doc/sphinx/issues/4258
          # Apply pre-processing to image.
          if self.input_format == "RGB":
              # whether the model expects BGR inputs or RGB
              original_image = original_image[:, :, ::-1]
          height, width = original_image.shape[:2]
          image = self.aug.get_transform(original_image).apply_image(
              original_image
          )
          image = torch.as_tensor(
              image.astype("float32").transpose(2, 0, 1)
          )
          image.to(self.cfg.MODEL.DEVICE)
  
          inputs = {"image": image, "height": height, "width": width}
  
          predictions = self.model([inputs])[0]
          return predictions
  
imports: import argparse
  import logging
  import os
  import sys
  import weakref
  from collections import OrderedDict
  from typing import Optional
  import torch
  from fvcore.nn.precise_bn import get_bn_modules
  from omegaconf import OmegaConf
  from torch.nn.parallel import DistributedDataParallel
  import detectron2.data.transforms
  from detectron2.checkpoint import DetectionCheckpointer
  from detectron2.config import CfgNode, LazyConfig
  from detectron2.data import MetadataCatalog, build_detection_test_loader, build_detection_train_loader
  from detectron2.evaluation import DatasetEvaluator, inference_on_dataset, print_csv_format, verify_results
  from detectron2.modeling import build_model
  from detectron2.solver import build_lr_scheduler, build_optimizer
  from detectron2.utils import comm
  from detectron2.utils.collect_env import collect_env_info
  from detectron2.utils.env import seed_all_rng
  from detectron2.utils.events import CommonMetricPrinter, JSONWriter, TensorboardXWriter
  from detectron2.utils.file_io import PathManager
  from detectron2.utils.logger import setup_logger
  from .None import hooks
  from .train_loop import AMPTrainer, SimpleTrainer, TrainerBase
label_desc: Use image node_id 2 for calling the DefaultPredictor obj's underlying member method code with example usage: obj.__call__(original_image) and returns: predictions