code: def __init__(
      self,
      in_channels=[1024, 512, 256],
      num_classes=15,
      act="swish",
      fpn_strides=(32, 16, 8),
      grid_cell_offset=0.5,
      angle_max=90,
      use_varifocal_loss=True,
      static_assigner_epoch=4,
      trt=False,
      export_onnx=False,
      static_assigner="ATSSAssigner",
      assigner="TaskAlignedAssigner",
      nms="MultiClassNMS",
      loss_weight={"class": 1.0, "iou": 2.5, "dfl": 0.05},
  ):
      super(PPYOLOERHead, self).__init__()
      assert len(in_channels) > 0, "len(in_channels) should > 0"
      self.in_channels = in_channels
      self.num_classes = num_classes
      self.fpn_strides = fpn_strides
      self.grid_cell_offset = grid_cell_offset
      self.angle_max = angle_max
      self.loss_weight = loss_weight
      self.use_varifocal_loss = use_varifocal_loss
      self.half_pi = paddle.to_tensor(
          [1.5707963267948966], dtype=paddle.float32
      )
      self.half_pi_bin = self.half_pi / angle_max
      self.iou_loss = ProbIoULoss()
      self.static_assigner_epoch = static_assigner_epoch
      self.static_assigner = static_assigner
      self.assigner = assigner
      self.nms = nms
      # stem
      self.stem_cls = nn.LayerList()
      self.stem_reg = nn.LayerList()
      self.stem_angle = nn.LayerList()
      trt = False if export_onnx else trt
      self.export_onnx = export_onnx
      act = (
          get_act_fn(act, trt=trt)
          if act is None or isinstance(act, (str, dict))
          else act
      )
      self.trt = trt
      for in_c in self.in_channels:
          self.stem_cls.append(ESEAttn(in_c, act=act))
          self.stem_reg.append(ESEAttn(in_c, act=act))
          self.stem_angle.append(ESEAttn(in_c, act=act))
      # pred head
      self.pred_cls = nn.LayerList()
      self.pred_reg = nn.LayerList()
      self.pred_angle = nn.LayerList()
      for in_c in self.in_channels:
          self.pred_cls.append(
              nn.Conv2D(in_c, self.num_classes, 3, padding=1)
          )
          self.pred_reg.append(nn.Conv2D(in_c, 4, 3, padding=1))
          self.pred_angle.append(
              nn.Conv2D(in_c, self.angle_max + 1, 3, padding=1)
          )
      self.angle_proj_conv = nn.Conv2D(
          self.angle_max + 1, 1, 1, bias_attr=False
      )
      self._init_weights()
  
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  from ppdet.core.workspace import register
  from ..losses import ProbIoULoss
  from ..initializer import bias_init_with_prob, constant_, normal_, vector_
  from ppdet.modeling.backbones.cspresnet import ConvBNLayer
  from ppdet.modeling.ops import get_static_shape, get_act_fn, anchor_generator
  from ppdet.modeling.layers import MultiClassNMS
label_desc: Use image node_id 1 to create a new PPYOLOERHead object from inherited base classes: nn with example: obj = PPYOLOERHead(in_channels, num_classes, act, fpn_strides, grid_cell_offset, angle_max, use_varifocal_loss, static_assigner_epoch, trt, export_onnx, static_assigner, assigner, nms, loss_weight)