class_docstr: Cascade roi head including one bbox head and one mask head.
  
  https://arxiv.org/abs/1712.00726
docstr: Initialize box head and box roi extractor.
  
  Args:
      bbox_roi_extractor (dict): Config of box roi extractor.
      bbox_head (dict): Config of box in box head.
docstr_tok: ["Initialize","box","head","and","box","roi","extractor",".","Args",":","bbox_roi_extractor","(","dict",")",":","Config","of","box","roi","extractor",".","bbox_head","(","dict",")",":","Config","of","box","in","box","head","."]
code: def init_bbox_head(self, bbox_roi_extractor, bbox_head):
      """Initialize box head and box roi extractor.
  
      Args:
          bbox_roi_extractor (dict): Config of box roi extractor.
          bbox_head (dict): Config of box in box head.
      """
      self.bbox_roi_extractor = nn.ModuleList()
      self.bbox_head = nn.ModuleList()
      if not isinstance(bbox_roi_extractor, list):
          bbox_roi_extractor = [
              bbox_roi_extractor for _ in range(self.num_stages)
          ]
      if not isinstance(bbox_head, list):
          bbox_head = [bbox_head for _ in range(self.num_stages)]
      assert (
          len(bbox_roi_extractor) == len(bbox_head) == self.num_stages
      )
      for roi_extractor, head in zip(bbox_roi_extractor, bbox_head):
          self.bbox_roi_extractor.append(
              build_roi_extractor(roi_extractor)
          )
          self.bbox_head.append(build_head(head))
  
imports: import torch
  import torch.nn
  from mmdet.core import bbox2result, bbox2roi, bbox_mapping, build_assigner, build_sampler, merge_aug_bboxes, merge_aug_masks, multiclass_nms
  from ..builder import HEADS, build_head, build_roi_extractor
  from .base_roi_head import BaseRoIHead
  from .test_mixins import BBoxTestMixin, MaskTestMixin
label_desc: Use image node_id 2 for calling the CascadeRoIHead obj's underlying member method code with example usage: obj.init_bbox_head(bbox_roi_extractor, bbox_head) without return types