code: def __init__(
      self,
      in_channels=[1024, 512, 256],
      num_classes=80,
      act="swish",
      fpn_strides=(32, 16, 8),
      grid_cell_scale=5.0,
      grid_cell_offset=0.5,
      reg_max=16,
      reg_range=None,
      static_assigner_epoch=4,
      use_varifocal_loss=True,
      static_assigner="ATSSAssigner",
      assigner="TaskAlignedAssigner",
      contrast_loss="SupContrast",
      nms="MultiClassNMS",
      eval_size=None,
      loss_weight={
          "class": 1.0,
          "iou": 2.5,
          "dfl": 0.5,
      },
      trt=False,
      attn_conv="convbn",
      exclude_nms=False,
      exclude_post_process=False,
      use_shared_conv=True,
      for_distill=False,
  ):
      super().__init__(
          in_channels,
          num_classes,
          act,
          fpn_strides,
          grid_cell_scale,
          grid_cell_offset,
          reg_max,
          reg_range,
          static_assigner_epoch,
          use_varifocal_loss,
          static_assigner,
          assigner,
          nms,
          eval_size,
          loss_weight,
          trt,
          attn_conv,
          exclude_nms,
          exclude_post_process,
          use_shared_conv,
          for_distill,
      )
  
      assert len(in_channels) > 0, "len(in_channels) should > 0"
      self.contrast_loss = contrast_loss
      self.contrast_encoder = nn.LayerList()
      for in_c in self.in_channels:
          self.contrast_encoder.append(
              nn.Conv2D(in_c, 128, 3, padding=1)
          )
      self._init_contrast_encoder()
  
file_path: PaddleDetection/ppdet/modeling/heads/ppyoloe_contrast_head.py
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from ppdet.core.workspace import register
  from ..initializer import bias_init_with_prob, constant_
  from ..assigners.utils import generate_anchors_for_grid_cell
  from ppdet.modeling.heads.ppyoloe_head import PPYOLOEHead
label_desc: Use image node_id 1 to create a new PPYOLOEContrastHead object from inherited base classes: PPYOLOEHead with example: obj = PPYOLOEContrastHead(in_channels, num_classes, act, fpn_strides, grid_cell_scale, grid_cell_offset, reg_max, reg_range, static_assigner_epoch, use_varifocal_loss, static_assigner, assigner, contrast_loss, nms, eval_size, loss_weight, trt, attn_conv, exclude_nms, exclude_post_process, use_shared_conv, for_distill)