class_docstr: SSD head used in https://arxiv.org/abs/1512.02325.
  
  Args:
      num_classes (int): Number of categories excluding the background
          category.
      in_channels (int): Number of channels in the input feature map.
      anchor_generator (dict): Config dict for anchor generator
      bbox_coder (dict): Config of bounding box coder.
      reg_decoded_bbox (bool): If true, the regression loss would be
          applied on decoded bounding boxes. Default: False
      train_cfg (dict): Training config of anchor head.
      test_cfg (dict): Testing config of anchor head.
code: def __init__(
      self,
      num_classes=80,
      in_channels=(512, 1024, 512, 256, 256, 256),
      anchor_generator=dict(
          type="SSDAnchorGenerator",
          scale_major=False,
          input_size=300,
          strides=[8, 16, 32, 64, 100, 300],
          ratios=([2], [2, 3], [2, 3], [2, 3], [2], [2]),
          basesize_ratio_range=(0.1, 0.9),
      ),
      bbox_coder=dict(
          type="DeltaXYWHBBoxCoder",
          clip_border=True,
          target_means=[0.0, 0.0, 0.0, 0.0],
          target_stds=[1.0, 1.0, 1.0, 1.0],
      ),
      reg_decoded_bbox=False,
      train_cfg=None,
      test_cfg=None,
  ):
      super(AnchorHead, self).__init__()
      self.num_classes = num_classes
      self.in_channels = in_channels
      self.cls_out_channels = num_classes + 1  # add background class
      self.anchor_generator = build_anchor_generator(anchor_generator)
      num_anchors = self.anchor_generator.num_base_anchors
  
      reg_convs = []
      cls_convs = []
      for i in range(len(in_channels)):
          reg_convs.append(
              nn.Conv2d(
                  in_channels[i],
                  num_anchors[i] * 4,
                  kernel_size=3,
                  padding=1,
              )
          )
          cls_convs.append(
              nn.Conv2d(
                  in_channels[i],
                  num_anchors[i] * (num_classes + 1),
                  kernel_size=3,
                  padding=1,
              )
          )
      self.reg_convs = nn.ModuleList(reg_convs)
      self.cls_convs = nn.ModuleList(cls_convs)
  
      self.bbox_coder = build_bbox_coder(bbox_coder)
      self.reg_decoded_bbox = reg_decoded_bbox
      self.use_sigmoid_cls = False
      self.cls_focal_loss = False
      self.train_cfg = train_cfg
      self.test_cfg = test_cfg
      # set sampling=False for archor_target
      self.sampling = False
      if self.train_cfg:
          self.assigner = build_assigner(self.train_cfg.assigner)
          # SSD sampling=False so use PseudoSampler
          sampler_cfg = dict(type="PseudoSampler")
          self.sampler = build_sampler(sampler_cfg, context=self)
      self.fp16_enabled = False
  
file_path: insightface/detection/scrfd/mmdet/models/dense_heads/ssd_head.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import xavier_init
  from mmcv.runner import force_fp32
  from mmdet.core import build_anchor_generator, build_assigner, build_bbox_coder, build_sampler, multi_apply
  from ..builder import HEADS
  from ..losses import smooth_l1_loss
  from .anchor_head import AnchorHead
label_desc: Use image node_id 1 to create a new SSDHead object from inherited base classes: AnchorHead with example: obj = SSDHead(num_classes, in_channels, anchor_generator, bbox_coder, reg_decoded_bbox, train_cfg, test_cfg)