class_docstr: Base class for mask heads used in One-Stage Instance Segmentation.
class_docstr_tok: ["Base","class","for","mask","heads","used","in","One-Stage","Instance","Segmentation","."]
docstr: Test function without test-time augmentation.
  
  Args:
      x (tuple[Tensor]): Multi-level features from the
          upstream network, each is a 4D-tensor.
      batch_data_samples (List[:obj:`DetDataSample`]): The Data
          Samples. It usually includes information such as
          `gt_instance`, `gt_panoptic_seg` and `gt_sem_seg`.
      rescale (bool, optional): Whether to rescale the results.
          Defaults to False.
      results_list (list[obj:`InstanceData`], optional): Detection
          results of each image after the post process. Only exist
          if there is a `bbox_head`, like `YOLACT`, `CondInst`, etc.
  
  Returns:
      list[obj:`InstanceData`]: Instance segmentation
      results of each image after the post process.
      Each item usually contains following keys.
  
          - scores (Tensor): Classification scores, has a shape
            (num_instance,)
          - labels (Tensor): Has a shape (num_instances,).
          - masks (Tensor): Processed mask results, has a
            shape (num_instances, h, w).
docstr_tok: ["Test","function","without","test-time","augmentation",".","Args",":","x","(","tuple","[","Tensor","]",")",":","Multi-level","features","from","the","upstream","network",",","each","is","a","4D-tensor",".","batch_data_samples","(","List","[",":","obj",":","`","DetDataSample","`","]",")",":","The","Data","Samples",".","It","usually","includes","information","such","as","`","gt_instance","`",",","`","gt_panoptic_seg","`","and","`","gt_sem_seg","`",".","rescale","(","bool",",","optional",")",":","Whether","to","rescale","the","results",".","Defaults","to","False",".","results_list","(","list","[","obj",":","`","InstanceData","`","]",",","optional",")",":","Detection","results","of","each","image","after","the","post","process",".","Only","exist","if","there","is","a","`","bbox_head","`",",","like","`","YOLACT","`",",","`","CondInst","`",",","etc",".","Returns",":","list","[","obj",":","`","InstanceData","`","]",":","Instance","segmentation","results","of","each","image","after","the","post","process",".","Each","item","usually","contains","following","keys",".","-","scores","(","Tensor",")",":","Classification","scores",",","has","a","shape","(","num_instance",",",")","-","labels","(","Tensor",")",":","Has","a","shape","(","num_instances",",",")",".","-","masks","(","Tensor",")",":","Processed","mask","results",",","has","a","shape","(","num_instances",",","h",",","w",")","."]
code: def predict(
      self,
      x: Tuple[Tensor],
      batch_data_samples: SampleList,
      rescale: bool = False,
      results_list: OptInstanceList = None,
      **kwargs,
  ) -> InstanceList:
      """Test function without test-time augmentation.
  
      Args:
          x (tuple[Tensor]): Multi-level features from the
              upstream network, each is a 4D-tensor.
          batch_data_samples (List[:obj:`DetDataSample`]): The Data
              Samples. It usually includes information such as
              `gt_instance`, `gt_panoptic_seg` and `gt_sem_seg`.
          rescale (bool, optional): Whether to rescale the results.
              Defaults to False.
          results_list (list[obj:`InstanceData`], optional): Detection
              results of each image after the post process. Only exist
              if there is a `bbox_head`, like `YOLACT`, `CondInst`, etc.
  
      Returns:
          list[obj:`InstanceData`]: Instance segmentation
          results of each image after the post process.
          Each item usually contains following keys.
  
              - scores (Tensor): Classification scores, has a shape
                (num_instance,)
              - labels (Tensor): Has a shape (num_instances,).
              - masks (Tensor): Processed mask results, has a
                shape (num_instances, h, w).
      """
      batch_img_metas = [
          data_samples.metainfo for data_samples in batch_data_samples
      ]
      if results_list is None:
          outs = self(x)
      else:
          outs = self(x, results_list)
  
      results_list = self.predict_by_feat(
          *outs,
          batch_img_metas=batch_img_metas,
          rescale=rescale,
          results_list=results_list,
          **kwargs,
      )
  
      return results_list
  
file_path: mmdetection/mmdet/models/dense_heads/base_mask_head.py
imports: from abc import ABCMeta, abstractmethod
  from typing import List, Tuple, Union
  from mmengine.model import BaseModule
  from torch import Tensor
  from mmdet.structures import SampleList
  from mmdet.utils import InstanceList, OptInstanceList, OptMultiConfig
  from ..utils import unpack_gt_instances
label_desc: Use image node_id 5 for calling the BaseMaskHead obj's underlying member method code with example usage: obj.predict(x, batch_data_samples, rescale, results_list) and returns: results_list