class_docstr: Cascade roi head including one bbox head and one mask head.
  
  https://arxiv.org/abs/1712.00726
docstr: Initialize the weights in head.
  
  Args:
      pretrained (str, optional): Path to pre-trained weights.
          Defaults to None.
docstr_tok: ["Initialize","the","weights","in","head",".","Args",":","pretrained","(","str",",","optional",")",":","Path","to","pre-trained","weights",".","Defaults","to","None","."]
code: def init_weights(self, pretrained):
      """Initialize the weights in head.
  
      Args:
          pretrained (str, optional): Path to pre-trained weights.
              Defaults to None.
      """
      if self.with_shared_head:
          self.shared_head.init_weights(pretrained=pretrained)
      for i in range(self.num_stages):
          if self.with_bbox:
              self.bbox_roi_extractor[i].init_weights()
              self.bbox_head[i].init_weights()
          if self.with_mask:
              if not self.share_roi_extractor:
                  self.mask_roi_extractor[i].init_weights()
              self.mask_head[i].init_weights()
  
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 5 for calling the CascadeRoIHead obj's underlying member method code with example usage: obj.init_weights(pretrained) without return types