def rect2rbox(self, bboxes):
        """
        :param bboxes: shape (L, 4) (xmin, ymin, xmax, ymax)
        :return: dbboxes: shape (L, 5) (x_ctr, y_ctr, w, h, angle)
        """
        x1, y1, x2, y2 = paddle.split(bboxes, 4, axis=-1)

        x_ctr = (x1 + x2) / 2.0
        y_ctr = (y1 + y2) / 2.0
        edges1 = paddle.abs(x2 - x1)
        edges2 = paddle.abs(y2 - y1)

        rbox_w = paddle.maximum(edges1, edges2)
        rbox_h = paddle.minimum(edges1, edges2)

        # set angle
        inds = edges1 < edges2
        inds = paddle.cast(inds, paddle.float32)
        rboxes_angle = inds * np.pi / 2.0

        rboxes = paddle.concat(
            (x_ctr, y_ctr, rbox_w, rbox_h, rboxes_angle), axis=-1)
        return rboxes

        :param bboxes: shape (L, 4) (xmin, ymin, xmax, ymax)
        :return: dbboxes: shape (L, 5) (x_ctr, y_ctr, w, h, angle)
        
ppdet/modeling/proposal_generator/anchor_generator.py