class_docstr: VGG Backbone network for single-shot-detection.
  
  Args:
      input_size (int): width and height of input, from {300, 512}.
      depth (int): Depth of vgg, from {11, 13, 16, 19}.
      out_indices (Sequence[int]): Output from which stages.
  
  Example:
      >>> self = SSDVGG(input_size=300, depth=11)
      >>> self.eval()
      >>> inputs = torch.rand(1, 3, 300, 300)
      >>> level_outputs = self.forward(inputs)
      >>> for level_out in level_outputs:
      ...     print(tuple(level_out.shape))
      (1, 1024, 19, 19)
      (1, 512, 10, 10)
      (1, 256, 5, 5)
      (1, 256, 3, 3)
      (1, 256, 1, 1)
class_docstr_tok: ["VGG","Backbone","network","for","single-shot-detection",".","Args",":","input_size","(","int",")",":","width","and","height","of","input",",","from","{","300",",","512","}",".","depth","(","int",")",":","Depth","of","vgg",",","from","{","11",",","13",",","16",",","19","}",".","out_indices","(","Sequence","[","int","]",")",":","Output","from","which","stages",".","Example",":",">",">",">","self","=","SSDVGG","(","input_size=300",",","depth=11",")",">",">",">","self.eval","(",")",">",">",">","inputs","=","torch.rand","(","1",",","3",",","300",",","300",")",">",">",">","level_outputs","=","self.forward","(","inputs",")",">",">",">","for","level_out","in","level_outputs",":","...","print","(","tuple","(","level_out.shape",")",")","(","1",",","1024",",","19",",","19",")","(","1",",","512",",","10",",","10",")","(","1",",","256",",","5",",","5",")","(","1",",","256",",","3",",","3",")","(","1",",","256",",","1",",","1",")"]
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.features.modules():
              if isinstance(m, nn.Conv2d):
                  kaiming_init(m)
              elif isinstance(m, nn.BatchNorm2d):
                  constant_init(m, 1)
              elif isinstance(m, nn.Linear):
                  normal_init(m, std=0.01)
      else:
          raise TypeError("pretrained must be a str or None")
  
      for m in self.extra.modules():
          if isinstance(m, nn.Conv2d):
              xavier_init(m, distribution="uniform")
  
      constant_init(self.l2_norm, self.l2_norm.scale)
  
file_path: insightface/detection/scrfd/mmdet/models/backbones/ssd_vgg.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import VGG, constant_init, kaiming_init, normal_init, xavier_init
  from mmcv.runner import load_checkpoint
  from mmdet.utils import get_root_logger
  from ..builder import BACKBONES
label_desc: Use image node_id 2 for calling the SSDVGG obj's underlying member method code with example usage: obj.init_weights(pretrained) without return types