예제 #1
0
def rotate_nms_cc(dets, thresh):
    scores = dets[:, 5]
    order = scores.argsort()[::-1].astype(np.int32)  # highest->lowest
    dets_corners = box_np_ops.center_to_corner_box2d(dets[:, :2], dets[:, 2:4],
                                                     dets[:, 4])

    dets_standup = box_np_ops.corner_to_standup_nd(dets_corners)

    standup_iou = box_np_ops.iou_jit(dets_standup, dets_standup, eps=0.0)
    # print(dets_corners.shape, order.shape, standup_iou.shape)
    return rotate_non_max_suppression_cpu(dets_corners, order, standup_iou,
                                          thresh)
def rotate_nms_3d_cc(dets, thresh, flag):
    assert dets.shape[1] == 8
    scores = dets[:, -1]
    ious_3d = boxes_iou_3d(dets[:, 0:7],
                           dets[:, 0:7],
                           aug_thickness=None,
                           criterion=-1,
                           flag=flag)
    ious_3d = ious_3d.cpu().data.numpy()
    order = scores.argsort().cpu().data.numpy().astype(
        np.int32)[::-1]  # highest->lowest
    dets_np = dets.cpu().data.numpy()
    dets_corners = box_np_ops.center_to_corner_box2d(dets_np[:, :2],
                                                     dets_np[:, 3:5],
                                                     dets_np[:, 6])
    #dets_standup = box_np_ops.corner_to_standup_nd(dets_corners)
    #standup_iou = box_np_ops.iou_jit(dets_standup, dets_standup, eps=0.0)
    # print(dets_corners.shape, order.shape, standup_iou.shape)
    indices = rotate_non_max_suppression_cpu(dets_corners, order, ious_3d,
                                             thresh)
    return indices