class_docstr: Cascade roi head including one bbox head and one mask head.
  
  https://arxiv.org/abs/1712.00726
code: def __init__(
      self,
      num_stages: int,
      stage_loss_weights: Union[List[float], Tuple[float]],
      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:
      assert bbox_roi_extractor is not None
      assert bbox_head is not None
      assert (
          shared_head is None
      ), "Shared head is not supported in Cascade RCNN anymore"
  
      self.num_stages = num_stages
      self.stage_loss_weights = stage_loss_weights
      super().__init__(
          bbox_roi_extractor=bbox_roi_extractor,
          bbox_head=bbox_head,
          mask_roi_extractor=mask_roi_extractor,
          mask_head=mask_head,
          shared_head=shared_head,
          train_cfg=train_cfg,
          test_cfg=test_cfg,
          init_cfg=init_cfg,
      )
  
imports: from typing import List, Sequence, Tuple, Union
  import torch
  import torch.nn
  from mmengine.model import ModuleList
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.models.task_modules.samplers import SamplingResult
  from mmdet.models.test_time_augs import merge_aug_masks
  from mmdet.registry import MODELS, TASK_UTILS
  from mmdet.structures import SampleList
  from mmdet.structures.bbox import bbox2roi, get_box_tensor
  from mmdet.utils import ConfigType, InstanceList, MultiConfig, OptConfigType, OptMultiConfig
  from ..utils.misc import empty_instances, unpack_gt_instances
  from .base_roi_head import BaseRoIHead
label_desc: Use image node_id 1 to create a new CascadeRoIHead object from inherited base classes: BaseRoIHead with example: obj = CascadeRoIHead(num_stages, stage_loss_weights, bbox_roi_extractor, bbox_head, mask_roi_extractor, mask_head, shared_head, train_cfg, test_cfg, init_cfg)