lilanxiao / Rotated_IoU

Differentiable IoU of rotated bounding boxes using Pytorch
MIT License
416 stars 64 forks source link

is this result correct? #38

Open sang0775 opened 2 years ago

sang0775 commented 2 years ago
import Rotated_IoU.oriented_iou_loss as ri
import torch
import numpy as np
import math
box1 = torch.tensor([[[0.,0.,2.,2.,torch.pi/4]]]).to("cuda")
iou,_,_,_ = ri.cal_iou(box1, box1)
print(iou)

above iou value is "0."

but when i change box angle torch.pi/4 to torch.pi/4 + 0.01, it return 1.0 and this is what i expected.

lilanxiao commented 2 years ago

Hi, thank you for your issue. I cannot reproduce this problem. I get "1" on my machine.

Are you using the latest version of my code? I updated the CUDA extension to fix some bugs a long time ago. Please consider pulling the repo again and re-compile the CUDA extension.

rubbish001 commented 2 years ago

最新版本的代码有问题,giou计算不准确