class_docstr: Simplest base roi head including one bbox head and one mask head.
docstr: Perform forward propagation and loss calculation of the detection
  roi on the features of the upstream network.
  
  Args:
      x (tuple[Tensor]): List of multi-level img features.
      rpn_results_list (list[:obj:`InstanceData`]): List of region
          proposals.
      DetSampleList (list[:obj:`DetDataSample`]): The batch
          data samples. It usually includes information such
          as `gt_instance` or `gt_panoptic_seg` or `gt_sem_seg`.
  
  Returns:
      dict[str, Tensor]: A dictionary of loss components
code: def loss(
      self, inputs: Tuple[Tensor], data_samples: DetSampleList
  ) -> dict:
      """Perform forward propagation and loss calculation of the detection
      roi on the features of the upstream network.
  
      Args:
          x (tuple[Tensor]): List of multi-level img features.
          rpn_results_list (list[:obj:`InstanceData`]): List of region
              proposals.
          DetSampleList (list[:obj:`DetDataSample`]): The batch
              data samples. It usually includes information such
              as `gt_instance` or `gt_panoptic_seg` or `gt_sem_seg`.
  
      Returns:
          dict[str, Tensor]: A dictionary of loss components
      """
      proposals = [
          ds.gt_instances[~ds.gt_instances.ignored]
          for ds in data_samples
      ]
  
      proposals = [p for p in proposals if len(p) > 0]
      bbox_feats = self.roi_extractor(inputs, proposals)
      rec_data_samples = [
          TextRecogDataSample(gt_text=LabelData(item=text))
          for proposal in proposals
          for text in proposal.texts
      ]
      return self.rec_head.loss(bbox_feats, rec_data_samples)
  
file_path: mmocr/projects/ABCNet/abcnet/model/rec_roi_head.py
imports: from typing import Tuple
  from mmengine.structures import LabelData
  from torch import Tensor
  from mmocr.registry import MODELS, TASK_UTILS
  from mmocr.structures import TextRecogDataSample
  from mmocr.utils import DetSampleList, OptMultiConfig, RecSampleList
  from .base_roi_head import BaseRoIHead
label_desc: Use image node_id 2 for calling the RecRoIHead obj's underlying member method code with example usage: obj.loss(inputs, data_samples) and returns: self