class_docstr: Base class for detectors.
docstr: Args:
      imgs (List[Tensor]): the outer list indicates test-time
          augmentations and inner Tensor should have a shape NxCxHxW,
          which contains all images in the batch.
      img_metas (List[List[dict]]): the outer list indicates test-time
          augs (multiscale, flip, etc.) and the inner list indicates
          images in a batch.
docstr_tok: ["Args",":","imgs","(","List","[","Tensor","]",")",":","the","outer","list","indicates","test-time","augmentations","and","inner","Tensor","should","have","a","shape","NxCxHxW",",","which","contains","all","images","in","the","batch",".","img_metas","(","List","[","List","[","dict","]","]",")",":","the","outer","list","indicates","test-time","augs","(","multiscale",",","flip",",","etc",".",")","and","the","inner","list","indicates","images","in","a","batch","."]
code: def forward_test(self, imgs, img_metas, **kwargs):
      """
      Args:
          imgs (List[Tensor]): the outer list indicates test-time
              augmentations and inner Tensor should have a shape NxCxHxW,
              which contains all images in the batch.
          img_metas (List[List[dict]]): the outer list indicates test-time
              augs (multiscale, flip, etc.) and the inner list indicates
              images in a batch.
      """
      for var, name in [(imgs, "imgs"), (img_metas, "img_metas")]:
          if not isinstance(var, list):
              raise TypeError(
                  f"{name} must be a list, but got {type(var)}"
              )
  
      num_augs = len(imgs)
      if num_augs != len(img_metas):
          raise ValueError(
              f"num of augmentations ({len(imgs)}) "
              f"!= num of image meta ({len(img_metas)})"
          )
  
      # NOTE the batched image size information may be useful, e.g.
      # in DETR, this is needed for the construction of masks, which is
      # then used for the transformer_head.
      for img, img_meta in zip(imgs, img_metas):
          batch_size = len(img_meta)
          for img_id in range(batch_size):
              img_meta[img_id]["batch_input_shape"] = tuple(
                  img.size()[-2:]
              )
  
      if num_augs == 1:
          # proposals (List[List[Tensor]]): the outer list indicates
          # test-time augs (multiscale, flip, etc.) and the inner list
          # indicates images in a batch.
          # The Tensor should have a shape Px4, where P is the number of
          # proposals.
          if "proposals" in kwargs:
              kwargs["proposals"] = kwargs["proposals"][0]
          return self.simple_test(imgs[0], img_metas[0], **kwargs)
      else:
          assert imgs[0].size(0) == 1, (
              "aug test does not support "
              "inference with batch size "
              f"{imgs[0].size(0)}"
          )
          # TODO: support test augmentation for predefined proposals
          assert "proposals" not in kwargs
          return self.aug_test(imgs, img_metas, **kwargs)
  
imports: from abc import ABCMeta, abstractmethod
  from collections import OrderedDict
  import mmcv
  import numpy
  import torch
  import torch.distributed
  import torch.nn
  from mmcv.runner import auto_fp16
  from mmcv.utils import print_log
  from mmdet.utils import get_root_logger
label_desc: Use image node_id 12 for calling the BaseDetector obj's underlying member method code with example usage: obj.forward_test(imgs, img_metas) and returns: self, self