def get_pred(self, bboxes, bbox_num, im_shape, scale_factor):
    '\n        Rescale, clip and filter the bbox from the output of NMS to \n        get final prediction. \n        \n        Notes:\n        Currently only support bs = 1.\n\n        Args:\n            bboxes (Tensor): The output bboxes with shape [N, 6] after decode\n                and NMS, including labels, scores and bboxes.\n            bbox_num (Tensor): The number of prediction boxes of each batch with\n                shape [1], and is N.\n            im_shape (Tensor): The shape of the input image.\n            scale_factor (Tensor): The scale factor of the input image.\n        Returns:\n            pred_result (Tensor): The final prediction results with shape [N, 6]\n                including labels, scores and bboxes.\n        '
    if (bboxes.shape[0] == 0):
        bboxes = self.fake_bboxes
        bbox_num = self.fake_bbox_num
    origin_shape = paddle.floor(((im_shape / scale_factor) + 0.5))
    origin_shape_list = []
    scale_factor_list = []
    for i in range(bbox_num.shape[0]):
        expand_shape = paddle.expand(origin_shape[i:(i + 1), :], [bbox_num[i], 2])
        (scale_y, scale_x) = (scale_factor[i][0], scale_factor[i][1])
        scale = paddle.concat([scale_x, scale_y, scale_x, scale_y])
        expand_scale = paddle.expand(scale, [bbox_num[i], 4])
        origin_shape_list.append(expand_shape)
        scale_factor_list.append(expand_scale)
    self.origin_shape_list = paddle.concat(origin_shape_list)
    scale_factor_list = paddle.concat(scale_factor_list)
    pred_label = bboxes[:, 0:1]
    pred_score = bboxes[:, 1:2]
    pred_bbox = bboxes[:, 2:]
    scaled_bbox = (pred_bbox / scale_factor_list)
    origin_h = self.origin_shape_list[:, 0]
    origin_w = self.origin_shape_list[:, 1]
    zeros = paddle.zeros_like(origin_h)
    x1 = paddle.maximum(paddle.minimum(scaled_bbox[:, 0], origin_w), zeros)
    y1 = paddle.maximum(paddle.minimum(scaled_bbox[:, 1], origin_h), zeros)
    x2 = paddle.maximum(paddle.minimum(scaled_bbox[:, 2], origin_w), zeros)
    y2 = paddle.maximum(paddle.minimum(scaled_bbox[:, 3], origin_h), zeros)
    pred_bbox = paddle.stack([x1, y1, x2, y2], axis=(- 1))
    keep_mask = nonempty_bbox(pred_bbox, return_mask=True)
    keep_mask = paddle.unsqueeze(keep_mask, [1])
    pred_label = paddle.where(keep_mask, pred_label, (paddle.ones_like(pred_label) * (- 1)))
    pred_result = paddle.concat([pred_label, pred_score, pred_bbox], axis=1)
    return pred_result
Rescale, clip and filter the bbox from the output of NMS to 
get final prediction. 

Notes:
Currently only support bs = 1.

Args:
    bboxes (Tensor): The output bboxes with shape [N, 6] after decode
        and NMS, including labels, scores and bboxes.
    bbox_num (Tensor): The number of prediction boxes of each batch with
        shape [1], and is N.
    im_shape (Tensor): The shape of the input image.
    scale_factor (Tensor): The scale factor of the input image.
Returns:
    pred_result (Tensor): The final prediction results with shape [N, 6]
        including labels, scores and bboxes.
def get_pred(self, bboxes, bbox_num, im_shape, scale_factor):
    '\n        Rescale, clip and filter the bbox from the output of NMS to \n        get final prediction. \n        \n        Notes:\n        Currently only support bs = 1.\n\n        Args:\n            bboxes (Tensor): The output bboxes with shape [N, 6] after decode\n                and NMS, including labels, scores and bboxes.\n            bbox_num (Tensor): The number of prediction boxes of each batch with\n                shape [1], and is N.\n            im_shape (Tensor): The shape of the input image.\n            scale_factor (Tensor): The scale factor of the input image.\n        Returns:\n            pred_result (Tensor): The final prediction results with shape [N, 6]\n                including labels, scores and bboxes.\n        '
    if (bboxes.shape[0] == 0):
        bboxes = self.fake_bboxes
        bbox_num = self.fake_bbox_num
    origin_shape = paddle.floor(((im_shape / scale_factor) + 0.5))
    origin_shape_list = []
    scale_factor_list = []
    for i in range(bbox_num.shape[0]):
        expand_shape = paddle.expand(origin_shape[i:(i + 1), :], [bbox_num[i], 2])
        (scale_y, scale_x) = (scale_factor[i][0], scale_factor[i][1])
        scale = paddle.concat([scale_x, scale_y, scale_x, scale_y])
        expand_scale = paddle.expand(scale, [bbox_num[i], 4])
        origin_shape_list.append(expand_shape)
        scale_factor_list.append(expand_scale)
    self.origin_shape_list = paddle.concat(origin_shape_list)
    scale_factor_list = paddle.concat(scale_factor_list)
    pred_label = bboxes[:, 0:1]
    pred_score = bboxes[:, 1:2]
    pred_bbox = bboxes[:, 2:]
    scaled_bbox = (pred_bbox / scale_factor_list)
    origin_h = self.origin_shape_list[:, 0]
    origin_w = self.origin_shape_list[:, 1]
    zeros = paddle.zeros_like(origin_h)
    x1 = paddle.maximum(paddle.minimum(scaled_bbox[:, 0], origin_w), zeros)
    y1 = paddle.maximum(paddle.minimum(scaled_bbox[:, 1], origin_h), zeros)
    x2 = paddle.maximum(paddle.minimum(scaled_bbox[:, 2], origin_w), zeros)
    y2 = paddle.maximum(paddle.minimum(scaled_bbox[:, 3], origin_h), zeros)
    pred_bbox = paddle.stack([x1, y1, x2, y2], axis=(- 1))
    keep_mask = nonempty_bbox(pred_bbox, return_mask=True)
    keep_mask = paddle.unsqueeze(keep_mask, [1])
    pred_label = paddle.where(keep_mask, pred_label, (paddle.ones_like(pred_label) * (- 1)))
    pred_result = paddle.concat([pred_label, pred_score, pred_bbox], axis=1)
    return pred_result