class_docstr: Base class for RoIHeads.
docstr: Perform forward propagation of the roi head and predict detection
  results on the features of the upstream network.
  
  Args:
      x (tuple[Tensor]): Features from upstream network. Each
          has shape (N, C, H, W).
      data_samples (List[:obj:`DetDataSample`]): The Data
          Samples. It usually includes `gt_instance`
  
  Returns:
      list[obj:`DetDataSample`]: Detection results of each image.
      Each item usually contains following keys in 'pred_instance'
  
          - scores (Tensor): Classification scores, has a shape
            (num_instance, )
          - labels (Tensor): Labels of bboxes, has a shape
            (num_instances, ).
          - bboxes (Tensor): Has a shape (num_instances, 4),
            the last dimension 4 arrange as (x1, y1, x2, y2).
          - polygon (List[Tensor]): Has a shape (num_instances, H, W).
docstr_tok: ["Perform","forward","propagation","of","the","roi","head","and","predict","detection","results","on","the","features","of","the","upstream","network",".","Args",":","x","(","tuple","[","Tensor","]",")",":","Features","from","upstream","network",".","Each","has","shape","(","N",",","C",",","H",",","W",")",".","data_samples","(","List","[",":","obj",":","`","DetDataSample","`","]",")",":","The","Data","Samples",".","It","usually","includes","`","gt_instance","`","Returns",":","list","[","obj",":","`","DetDataSample","`","]",":","Detection","results","of","each","image",".","Each","item","usually","contains","following","keys","in","'pred_instance'","-","scores","(","Tensor",")",":","Classification","scores",",","has","a","shape","(","num_instance",",",")","-","labels","(","Tensor",")",":","Labels","of","bboxes",",","has","a","shape","(","num_instances",",",")",".","-","bboxes","(","Tensor",")",":","Has","a","shape","(","num_instances",",","4",")",",","the","last","dimension","4","arrange","as","(","x1",",","y1",",","x2",",","y2",")",".","-","polygon","(","List","[","Tensor","]",")",":","Has","a","shape","(","num_instances",",","H",",","W",")","."]
code: def predict(
      self, x: Tuple[Tensor], data_samples: DetSampleList
  ) -> DetSampleList:
      """Perform forward propagation of the roi head and predict detection
      results on the features of the upstream network.
  
      Args:
          x (tuple[Tensor]): Features from upstream network. Each
              has shape (N, C, H, W).
          data_samples (List[:obj:`DetDataSample`]): The Data
              Samples. It usually includes `gt_instance`
  
      Returns:
          list[obj:`DetDataSample`]: Detection results of each image.
          Each item usually contains following keys in 'pred_instance'
  
              - scores (Tensor): Classification scores, has a shape
                (num_instance, )
              - labels (Tensor): Labels of bboxes, has a shape
                (num_instances, ).
              - bboxes (Tensor): Has a shape (num_instances, 4),
                the last dimension 4 arrange as (x1, y1, x2, y2).
              - polygon (List[Tensor]): Has a shape (num_instances, H, W).
      """
  
file_path: mmocr/projects/ABCNet/abcnet/model/base_roi_head.py
imports: from abc import ABCMeta, abstractmethod
  from typing import Tuple
  from mmengine.model import BaseModule
  from torch import Tensor
  from mmocr.utils import DetSampleList
label_desc: Use image node_id 4 for calling the BaseRoIHead obj's underlying member method code with example usage: obj.predict(x, data_samples) without return types