def get_bboxes(self, cls_score_list, bbox_pred_list, mlvl_anchors, nms_pre, cls_out_channels, use_sigmoid_cls):
    assert (len(cls_score_list) == len(bbox_pred_list) == len(mlvl_anchors))
    mlvl_bboxes = []
    mlvl_scores = []
    idx = 0
    for (cls_score, bbox_pred, anchors) in zip(cls_score_list, bbox_pred_list, mlvl_anchors):
        cls_score = paddle.reshape(cls_score, [(- 1), cls_out_channels])
        if use_sigmoid_cls:
            scores = F.sigmoid(cls_score)
        else:
            scores = F.softmax(cls_score, axis=(- 1))
        bbox_pred = paddle.transpose(bbox_pred, [1, 2, 0])
        bbox_pred = paddle.reshape(bbox_pred, [(- 1), 5])
        anchors = paddle.reshape(anchors, [(- 1), 5])
        if (scores.shape[0] > nms_pre):
            if use_sigmoid_cls:
                max_scores = paddle.max(scores, axis=1)
            else:
                max_scores = paddle.max(scores[:, 1:], axis=1)
            (topk_val, topk_inds) = paddle.topk(max_scores, nms_pre)
            anchors = paddle.gather(anchors, topk_inds)
            bbox_pred = paddle.gather(bbox_pred, topk_inds)
            scores = paddle.gather(scores, topk_inds)
        bbox_delta = paddle.reshape(bbox_pred, [(- 1), 5])
        bboxes = self.delta2rbox(anchors, bbox_delta)
        mlvl_bboxes.append(bboxes)
        mlvl_scores.append(scores)
        idx += 1
    mlvl_bboxes = paddle.concat(mlvl_bboxes, axis=0)
    mlvl_scores = paddle.concat(mlvl_scores)
    return (mlvl_scores, mlvl_bboxes)
def get_bboxes(self, cls_score_list, bbox_pred_list, mlvl_anchors, nms_pre, cls_out_channels, use_sigmoid_cls):
    assert (len(cls_score_list) == len(bbox_pred_list) == len(mlvl_anchors))
    mlvl_bboxes = []
    mlvl_scores = []
    idx = 0
    for (cls_score, bbox_pred, anchors) in zip(cls_score_list, bbox_pred_list, mlvl_anchors):
        cls_score = paddle.reshape(cls_score, [(- 1), cls_out_channels])
        if use_sigmoid_cls:
            scores = F.sigmoid(cls_score)
        else:
            scores = F.softmax(cls_score, axis=(- 1))
        bbox_pred = paddle.transpose(bbox_pred, [1, 2, 0])
        bbox_pred = paddle.reshape(bbox_pred, [(- 1), 5])
        anchors = paddle.reshape(anchors, [(- 1), 5])
        if (scores.shape[0] > nms_pre):
            if use_sigmoid_cls:
                max_scores = paddle.max(scores, axis=1)
            else:
                max_scores = paddle.max(scores[:, 1:], axis=1)
            (topk_val, topk_inds) = paddle.topk(max_scores, nms_pre)
            anchors = paddle.gather(anchors, topk_inds)
            bbox_pred = paddle.gather(bbox_pred, topk_inds)
            scores = paddle.gather(scores, topk_inds)
        bbox_delta = paddle.reshape(bbox_pred, [(- 1), 5])
        bboxes = self.delta2rbox(anchors, bbox_delta)
        mlvl_bboxes.append(bboxes)
        mlvl_scores.append(scores)
        idx += 1
    mlvl_bboxes = paddle.concat(mlvl_bboxes, axis=0)
    mlvl_scores = paddle.concat(mlvl_scores)
    return (mlvl_scores, mlvl_bboxes)