class_docstr: Head of CentripetalNet: Pursuing High-quality Keypoint Pairs for Object
  Detection.
  
  CentripetalHead inherits from :class:`CornerHead`. It removes the
  embedding branch and adds guiding shift and centripetal shift branches.
  More details can be found in the `paper
  <https://arxiv.org/abs/2003.09119>`_ .
  
  Args:
      num_classes (int): Number of categories excluding the background
          category.
      in_channels (int): Number of channels in the input feature map.
      num_feat_levels (int): Levels of feature from the previous module. 2
          for HourglassNet-104 and 1 for HourglassNet-52. HourglassNet-104
          outputs the final feature and intermediate supervision feature and
          HourglassNet-52 only outputs the final feature. Default: 2.
      corner_emb_channels (int): Channel of embedding vector. Default: 1.
      train_cfg (dict | None): Training config. Useless in CornerHead,
          but we keep this variable for SingleStageDetector. Default: None.
      test_cfg (dict | None): Testing config of CornerHead. Default: None.
      loss_heatmap (dict | None): Config of corner heatmap loss. Default:
          GaussianFocalLoss.
      loss_embedding (dict | None): Config of corner embedding loss. Default:
          AssociativeEmbeddingLoss.
      loss_offset (dict | None): Config of corner offset loss. Default:
          SmoothL1Loss.
      loss_guiding_shift (dict): Config of guiding shift loss. Default:
          SmoothL1Loss.
      loss_centripetal_shift (dict): Config of centripetal shift loss.
          Default: SmoothL1Loss.
docstr: Initialize centripetal layers.
  
  Including feature adaption deform convs (feat_adaption), deform offset
  prediction convs (dcn_off), guiding shift (guiding_shift) and
  centripetal shift ( centripetal_shift). Each branch has two parts:
  prefix `tl_` for top-left and `br_` for bottom-right.
docstr_tok: ["Initialize","centripetal","layers",".","Including","feature","adaption","deform","convs","(","feat_adaption",")",",","deform","offset","prediction","convs","(","dcn_off",")",",","guiding","shift","(","guiding_shift",")","and","centripetal","shift","(","centripetal_shift",")",".","Each","branch","has","two","parts",":","prefix","`","tl_","`","for","top-left","and","`","br_","`","for","bottom-right","."]
code: def _init_centripetal_layers(self):
      """Initialize centripetal layers.
  
      Including feature adaption deform convs (feat_adaption), deform offset
      prediction convs (dcn_off), guiding shift (guiding_shift) and
      centripetal shift ( centripetal_shift). Each branch has two parts:
      prefix `tl_` for top-left and `br_` for bottom-right.
      """
      self.tl_feat_adaption = nn.ModuleList()
      self.br_feat_adaption = nn.ModuleList()
      self.tl_dcn_offset = nn.ModuleList()
      self.br_dcn_offset = nn.ModuleList()
      self.tl_guiding_shift = nn.ModuleList()
      self.br_guiding_shift = nn.ModuleList()
      self.tl_centripetal_shift = nn.ModuleList()
      self.br_centripetal_shift = nn.ModuleList()
  
      for _ in range(self.num_feat_levels):
          self.tl_feat_adaption.append(
              DeformConv2d(
                  self.in_channels,
                  self.in_channels,
                  self.feat_adaption_conv_kernel,
                  1,
                  1,
              )
          )
          self.br_feat_adaption.append(
              DeformConv2d(
                  self.in_channels,
                  self.in_channels,
                  self.feat_adaption_conv_kernel,
                  1,
                  1,
              )
          )
  
          self.tl_guiding_shift.append(
              self._make_layers(
                  out_channels=self.guiding_shift_channels,
                  in_channels=self.in_channels,
              )
          )
          self.br_guiding_shift.append(
              self._make_layers(
                  out_channels=self.guiding_shift_channels,
                  in_channels=self.in_channels,
              )
          )
  
          self.tl_dcn_offset.append(
              ConvModule(
                  self.guiding_shift_channels,
                  self.feat_adaption_conv_kernel**2
                  * self.guiding_shift_channels,
                  1,
                  bias=False,
                  act_cfg=None,
              )
          )
          self.br_dcn_offset.append(
              ConvModule(
                  self.guiding_shift_channels,
                  self.feat_adaption_conv_kernel**2
                  * self.guiding_shift_channels,
                  1,
                  bias=False,
                  act_cfg=None,
              )
          )
  
          self.tl_centripetal_shift.append(
              self._make_layers(
                  out_channels=self.centripetal_shift_channels,
                  in_channels=self.in_channels,
              )
          )
          self.br_centripetal_shift.append(
              self._make_layers(
                  out_channels=self.centripetal_shift_channels,
                  in_channels=self.in_channels,
              )
          )
  
file_path: insightface/detection/scrfd/mmdet/models/dense_heads/centripetal_head.py
imports: import torch.nn
  from mmcv.cnn import ConvModule, normal_init
  from mmcv.ops import DeformConv2d
  from mmdet.core import multi_apply
  from ..builder import HEADS, build_loss
  from .corner_head import CornerHead
label_desc: Use image node_id 2 for calling the CentripetalHead obj's underlying member method code with example usage: obj._init_centripetal_layers() without return types