class_docstr: Base class for single-stage detectors.
  
  Single-stage detectors directly and densely predict bounding boxes on the
  output features of the backbone+neck.
docstr: Initialize the weights in detector.
  
  Args:
      pretrained (str, optional): Path to pre-trained weights.
          Defaults to None.
docstr_tok: ["Initialize","the","weights","in","detector",".","Args",":","pretrained","(","str",",","optional",")",":","Path","to","pre-trained","weights",".","Defaults","to","None","."]
code: def init_weights(self, pretrained=None):
      """Initialize the weights in detector.
  
      Args:
          pretrained (str, optional): Path to pre-trained weights.
              Defaults to None.
      """
      super(SingleStageDetector, self).init_weights(pretrained)
      self.backbone.init_weights(pretrained=pretrained)
      if self.with_neck:
          if isinstance(self.neck, nn.Sequential):
              for m in self.neck:
                  m.init_weights()
          else:
              self.neck.init_weights()
      self.bbox_head.init_weights()
  
file_path: insightface/detection/scrfd/mmdet/models/detectors/single_stage.py
imports: import torch
  import torch.nn
  from mmdet.core import bbox2result
  from ..builder import DETECTORS, build_backbone, build_head, build_neck
  from .base import BaseDetector
label_desc: Use image node_id 2 for calling the SingleStageDetector obj's underlying member method code with example usage: obj.init_weights(pretrained) without return types