class_docstr: Base class for RoIHeads.
class_docstr_tok: ["Base","class","for","RoIHeads","."]
code: def __init__(
      self,
      bbox_roi_extractor: OptMultiConfig = None,
      bbox_head: OptMultiConfig = None,
      mask_roi_extractor: OptMultiConfig = None,
      mask_head: OptMultiConfig = None,
      shared_head: OptConfigType = None,
      train_cfg: OptConfigType = None,
      test_cfg: OptConfigType = None,
      init_cfg: OptMultiConfig = None,
  ) -> None:
      super().__init__(init_cfg=init_cfg)
      self.train_cfg = train_cfg
      self.test_cfg = test_cfg
      if shared_head is not None:
          self.shared_head = MODELS.build(shared_head)
  
      if bbox_head is not None:
          self.init_bbox_head(bbox_roi_extractor, bbox_head)
  
      if mask_head is not None:
          self.init_mask_head(mask_roi_extractor, mask_head)
  
      self.init_assigner_sampler()
  
file_path: mmdetection/mmdet/models/roi_heads/base_roi_head.py
imports: from abc import ABCMeta, abstractmethod
  from typing import Tuple
  from mmengine.model import BaseModule
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures import SampleList
  from mmdet.utils import InstanceList, OptConfigType, OptMultiConfig
label_desc: Use image node_id 1 to create a new BaseRoIHead object from inherited base classes: BaseModule with example: obj = BaseRoIHead(bbox_roi_extractor, bbox_head, mask_roi_extractor, mask_head, shared_head, train_cfg, test_cfg, init_cfg)