class_docstr: SSDHead
  
  Args:
      num_classes (int): Number of classes
      in_channels (list): Number of channels per input feature
      anchor_generator (dict): Configuration of 'AnchorGeneratorSSD' instance
      kernel_size (int): Conv kernel size
      padding (int): Conv padding
      use_sepconv (bool): Use SepConvLayer if true
      conv_decay (float): Conv regularization coeff
      loss (object): 'SSDLoss' instance
      use_extra_head (bool): If use ResNet34 as baskbone, you should set `use_extra_head`=True
code: def __init__(
      self,
      num_classes=80,
      in_channels=(512, 1024, 512, 256, 256, 256),
      anchor_generator=_get_class_default_kwargs(AnchorGeneratorSSD),
      kernel_size=3,
      padding=1,
      use_sepconv=False,
      conv_decay=0.0,
      loss="SSDLoss",
      use_extra_head=False,
  ):
      super(SSDHead, self).__init__()
      # add background class
      self.num_classes = num_classes + 1
      self.in_channels = in_channels
      self.anchor_generator = anchor_generator
      self.loss = loss
      self.use_extra_head = use_extra_head
  
      if self.use_extra_head:
          self.ssd_extra_head = SSDExtraHead()
          self.in_channels = [256, 512, 512, 256, 256, 256]
  
      if isinstance(anchor_generator, dict):
          self.anchor_generator = AnchorGeneratorSSD(**anchor_generator)
  
      self.num_priors = self.anchor_generator.num_priors
      self.box_convs = []
      self.score_convs = []
      for i, num_prior in enumerate(self.num_priors):
          box_conv_name = "boxes{}".format(i)
          if not use_sepconv:
              box_conv = self.add_sublayer(
                  box_conv_name,
                  nn.Conv2D(
                      in_channels=self.in_channels[i],
                      out_channels=num_prior * 4,
                      kernel_size=kernel_size,
                      padding=padding,
                  ),
              )
          else:
              box_conv = self.add_sublayer(
                  box_conv_name,
                  SepConvLayer(
                      in_channels=self.in_channels[i],
                      out_channels=num_prior * 4,
                      kernel_size=kernel_size,
                      padding=padding,
                      conv_decay=conv_decay,
                  ),
              )
          self.box_convs.append(box_conv)
  
          score_conv_name = "scores{}".format(i)
          if not use_sepconv:
              score_conv = self.add_sublayer(
                  score_conv_name,
                  nn.Conv2D(
                      in_channels=self.in_channels[i],
                      out_channels=num_prior * self.num_classes,
                      kernel_size=kernel_size,
                      padding=padding,
                  ),
              )
          else:
              score_conv = self.add_sublayer(
                  score_conv_name,
                  SepConvLayer(
                      in_channels=self.in_channels[i],
                      out_channels=num_prior * self.num_classes,
                      kernel_size=kernel_size,
                      padding=padding,
                      conv_decay=conv_decay,
                  ),
              )
          self.score_convs.append(score_conv)
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from ppdet.core.workspace import register
  from paddle.regularizer import L2Decay
  from paddle import ParamAttr
  from ..layers import AnchorGeneratorSSD
  from ..cls_utils import _get_class_default_kwargs
label_desc: Use image node_id 1 to create a new SSDHead object from inherited base classes: nn with example: obj = SSDHead(num_classes, in_channels, anchor_generator, kernel_size, padding, use_sepconv, conv_decay, loss, use_extra_head)