def multiclass_nms_rotated(pred_bboxes,
                           pred_scores,
                           iou_threshlod=0.1,
                           score_threshold=0.1):
    """
    Args:
        pred_bboxes (numpy.ndarray): [B, N, 8]
        pred_scores (numpy.ndarray): [B, C, N]
    
    Return:
        bboxes (numpy.ndarray): [N, 10]
        bbox_num (numpy.ndarray): [B]
    """
    bbox_num = []
    bboxes = []
    for bbox_per_img, score_per_img in zip(pred_bboxes, pred_scores):
        num_per_img = 0
        for cls_id, score_per_cls in enumerate(score_per_img):
            keep_mask = score_per_cls > score_threshold
            bbox = bbox_per_img[keep_mask]
            score = score_per_cls[keep_mask]

            idx = score.argsort()[::-1]
            bbox = bbox[idx]
            score = score[idx]
            keep_idx = []
            for i, b in enumerate(bbox):
                supressed = False
                for gi in keep_idx:
                    g = bbox[gi]
                    if rbox_iou(b, g) > iou_threshlod:
                        supressed = True
                        break

                if supressed:
                    continue

                keep_idx.append(i)

            keep_box = bbox[keep_idx]
            keep_score = score[keep_idx]
            keep_cls_ids = np.ones(len(keep_idx)) * cls_id
            bboxes.append(
                np.concatenate(
                    [keep_cls_ids[:, None], keep_score[:, None], keep_box],
                    axis=-1))
            num_per_img += len(keep_idx)

        bbox_num.append(num_per_img)

    return np.concatenate(bboxes, axis=0), np.array(bbox_num)

    Args:
        pred_bboxes (numpy.ndarray): [B, N, 8]
        pred_scores (numpy.ndarray): [B, C, N]
    
    Return:
        bboxes (numpy.ndarray): [N, 10]
        bbox_num (numpy.ndarray): [B]
    
configs/rotate/tools/onnx_infer.py