class_docstr: S2Anet head
  Args:
      stacked_convs (int): number of stacked_convs
      feat_in (int): input channels of feat
      feat_out (int): output channels of feat
      num_classes (int): num_classes
      anchor_strides (list): stride of anchors
      anchor_scales (list): scale of anchors
      anchor_ratios (list): ratios of anchors
      target_means (list): target_means
      target_stds (list): target_stds
      align_conv_type (str): align_conv_type ['Conv', 'AlignConv']
      align_conv_size (int): kernel size of align_conv
      use_sigmoid_cls (bool): use sigmoid_cls or not
      reg_loss_weight (list): loss weight for regression
class_docstr_tok: ["S2Anet","head","Args",":","stacked_convs","(","int",")",":","number","of","stacked_convs","feat_in","(","int",")",":","input","channels","of","feat","feat_out","(","int",")",":","output","channels","of","feat","num_classes","(","int",")",":","num_classes","anchor_strides","(","list",")",":","stride","of","anchors","anchor_scales","(","list",")",":","scale","of","anchors","anchor_ratios","(","list",")",":","ratios","of","anchors","target_means","(","list",")",":","target_means","target_stds","(","list",")",":","target_stds","align_conv_type","(","str",")",":","align_conv_type","[","'Conv","'",",","'AlignConv","'","]","align_conv_size","(","int",")",":","kernel","size","of","align_conv","use_sigmoid_cls","(","bool",")",":","use","sigmoid_cls","or","not","reg_loss_weight","(","list",")",":","loss","weight","for","regression"]
docstr: rboxes: [x_ctr,y_ctr,w,h,angle]
  to
  polys: [x0,y0,x1,y1,x2,y2,x3,y3]
docstr_tok: ["rboxes",":","[","x_ctr",",","y_ctr",",","w",",","h",",","angle","]","to","polys",":","[","x0",",","y0",",","x1",",","y1",",","x2",",","y2",",","x3",",","y3","]"]
code: def rbox2poly(self, rboxes):
      """
      rboxes: [x_ctr,y_ctr,w,h,angle]
      to
      polys: [x0,y0,x1,y1,x2,y2,x3,y3]
      """
      N = paddle.shape(rboxes)[0]
  
      x_ctr = rboxes[:, 0]
      y_ctr = rboxes[:, 1]
      width = rboxes[:, 2]
      height = rboxes[:, 3]
      angle = rboxes[:, 4]
  
      tl_x, tl_y, br_x, br_y = (
          -width * 0.5,
          -height * 0.5,
          width * 0.5,
          height * 0.5,
      )
  
      normal_rects = paddle.stack(
          [tl_x, br_x, br_x, tl_x, tl_y, tl_y, br_y, br_y], axis=0
      )
      normal_rects = paddle.reshape(normal_rects, [2, 4, N])
      normal_rects = paddle.transpose(normal_rects, [2, 0, 1])
  
      sin, cos = paddle.sin(angle), paddle.cos(angle)
      # M: [N,2,2]
      M = paddle.stack([cos, -sin, sin, cos], axis=0)
      M = paddle.reshape(M, [2, 2, N])
      M = paddle.transpose(M, [2, 0, 1])
  
      # polys: [N,8]
      polys = paddle.matmul(M, normal_rects)
      polys = paddle.transpose(polys, [2, 1, 0])
      polys = paddle.reshape(polys, [-1, N])
      polys = paddle.transpose(polys, [1, 0])
  
      tmp = paddle.stack(
          [x_ctr, y_ctr, x_ctr, y_ctr, x_ctr, y_ctr, x_ctr, y_ctr],
          axis=1,
      )
      polys = polys + tmp
      return polys
  
imports: import paddle
  from paddle import ParamAttr
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn.initializer import Normal, Constant
  from ppdet.core.workspace import register
  from ppdet.modeling.proposal_generator.target_layer import RBoxAssigner
  from ppdet.modeling.proposal_generator.anchor_generator import S2ANetAnchorGenerator
  from ppdet.modeling.layers import AlignConv
  from ..cls_utils import _get_class_default_kwargs
  import numpy
label_desc: Use image node_id 11 for calling the S2ANetHead obj's underlying member method code with example usage: obj.rbox2poly(rboxes) and returns: polys