incorrect iou?
See original GitHub issueHi @lilanxiao ,
Maybe I’m missing something but:
device = torch.device('cuda:0')
box_0 = torch.tensor([.0, .0, 2., 2., .0], device=device)
box_1 = torch.tensor([.0, 2., 2., 2., .0], device=device)
print(cal_iou(box_0[None, None, ...], box_1[None, None, ...])[0].cpu().numpy())
returns [[0.33333334]]
.
However, these 2 boxes are not intersecting.
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
Incorrect IOU values obtained in a segmentation task using ...
I am measuring IOU and Dice values using a set of ground truth and predicted masks that are generated by a U-Net model....
Read more >Incorrect IOU definition #36 - 4uiiurz1/pytorch-nested-unet
The current IOU implementation has calculated the union and intersection over samples in a mini-batch, then it has calculated the IOU score.
Read more >IoU a better detection evaluation metric | by Eric Hofesmann
High confidence false positives; Individual samples to spot check performance; Performance on classes most relevant to your task. What is mAP?
Read more >Intersection over Union (IoU) for object detection
Intersection over Union (IoU) for object detection ... labels where your model outputs a single label that is either correct or incorrect.
Read more >Understanding intersection-over-union - Caleb Robinson
Intersection-over-union (IoU), also known as the Jaccard index, is a commonly used measure for determining how accurate a proposed image ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kevinghst thank you for the issue! Yeah, it seems my dark magic didn’t work. The true reason of the error was the vertices of the intersection polygon were duplicated (we only need 4, but would get 8) if the two boxes were exactly the same. In this case, the shoelace formula was broken. Also, there was still some numerically instability in my code.
I hope the bug is now properly fixed in commit 6267cefca26cbcd742bfb3cc4ae8064ba0b7a1da . This time I’ve modified the CUDA part and removed the magic. BTW, please remember to re-compile the CUDA extension.
Probably this
EPSILON
stuff is not the best idea here. After replacingwith
everything looks fine.