docstr: Initialize mask head and mask roi extractor.
  
  Args:
      mask_head (dict): Config of mask in mask head.
      mask_roi_extractor (:obj:`ConfigDict`, dict or list):
          Config of mask roi extractor.
docstr_tok: ["Initialize","mask","head","and","mask","roi","extractor",".","Args",":","mask_head","(","dict",")",":","Config","of","mask","in","mask","head",".","mask_roi_extractor","(",":","obj",":","`","ConfigDict","`",",","dict","or","list",")",":","Config","of","mask","roi","extractor","."]
code: def init_mask_head(
      self, mask_roi_extractor: MultiConfig, mask_head: MultiConfig
  ) -> None:
      """Initialize mask head and mask roi extractor.
  
      Args:
          mask_head (dict): Config of mask in mask head.
          mask_roi_extractor (:obj:`ConfigDict`, dict or list):
              Config of mask roi extractor.
      """
      self.mask_head = MODELS.build(mask_head)
  
      if mask_roi_extractor is not None:
          self.share_roi_extractor = False
          self.mask_roi_extractor = MODELS.build(mask_roi_extractor)
      else:
          self.share_roi_extractor = True
          self.mask_roi_extractor = self.bbox_roi_extractor
  
imports: from typing import List, Sequence, Tuple
  import torch
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.models.roi_heads import CascadeRoIHead
  from mmdet.models.task_modules.samplers import SamplingResult
  from mmdet.models.test_time_augs import merge_aug_masks
  from mmdet.models.utils.misc import empty_instances
  from mmdet.registry import MODELS
  from mmdet.structures import SampleList
  from mmdet.structures.bbox import bbox2roi, get_box_tensor
  from mmdet.utils import ConfigType, InstanceList, MultiConfig
label_desc: Use image node_id 1 for calling the DeticRoIHead obj's underlying member method code with example usage: obj.init_mask_head(mask_roi_extractor, mask_head) without return types