docstr: Initialize the weights in backbone.
  
  Args:
      pretrained (str, optional): Path to pre-trained weights.
          Defaults to None.
docstr_tok: ["Initialize","the","weights","in","backbone",".","Args",":","pretrained","(","str",",","optional",")",":","Path","to","pre-trained","weights",".","Defaults","to","None","."]
code: def init_weights(self, pretrained=None):
      """Initialize the weights in backbone.
  
      Args:
          pretrained (str, optional): Path to pre-trained weights.
              Defaults to None.
      """
      if isinstance(pretrained, str):
          logger = get_root_logger()
          load_checkpoint(self, pretrained, strict=False, logger=logger)
      elif pretrained is None:
          for m in self.modules():
              if isinstance(m, nn.Conv2d):
                  kaiming_init(m)
              elif isinstance(m, (_BatchNorm, nn.GroupNorm)):
                  constant_init(m, 1)
      else:
          raise TypeError("pretrained must be a str or None")
  
file_path: insightface/detection/scrfd/mmdet/models/backbones/mobilenet.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import torch
  import torch.nn
  from mmdet.utils import get_root_logger
  from mmcv.cnn import build_conv_layer, build_norm_layer, build_plugin_layer, constant_init, kaiming_init
  from mmcv.runner import load_checkpoint
  from torch.nn.modules.batchnorm import _BatchNorm
  from ..builder import BACKBONES
label_desc: Use image node_id 3 for calling the MobileNetV1 obj's underlying member method code with example usage: obj.init_weights(pretrained) without return types