Rotated_IoU icon indicating copy to clipboard operation
Rotated_IoU copied to clipboard

Bug in cal_dious_3d function

Open ShuojieMo opened this issue 4 years ago • 1 comments

.Bug was found when I use the cal_iou_3d() . IoU result of two bbox3d will get wrong when the angle = np.pi/4 , but get correct when the angle = np.pi/4 + 1e-6. Following is my test case:

import torch
from oriented_iou_loss import cal_diou_3d

x = torch.tensor([0., 0., 0., 2., 2., 2., np.pi/4]
                 ).view(1, 1, 7).cuda()
y = torch.tensor([0., 0., 0., 2., 2., 2., -np.pi/4]).view(1, 1, 7).cuda()

_, iou3d = cal_diou_3d(x, y)
## iou3d = 0 , wrong

x = torch.tensor([0., 0., 0., 2., 2., 2., np.pi/4+1e-6]
                 ).view(1, 1, 7).cuda()
y = torch.tensor([0., 0., 0., 2., 2., 2., -np.pi/4+1e-6]).view(1, 1, 7).cuda()

_, iou3d = cal_diou_3d(x, y)
## iou3d =1, Right

ShuojieMo avatar Jul 29 '21 08:07 ShuojieMo

Hi, I cannot reproduce this bug. I got iou3d=1 in both cases.

Did you use the latest version of my code? I fixed some bugs several months ago. Please consider pulling this repo again and re-compiling the CUDA extension. Also, you might need to delete the generated files under cuda_op before the re-compilation.

lilanxiao avatar Aug 13 '21 10:08 lilanxiao