PETR icon indicating copy to clipboard operation
PETR copied to clipboard

Why IoU calculation is (I + I)/(I +U)

Open evakasch opened this issue 1 year ago • 1 comments

The IoU function seems to be (I + I)/(I +U) in mmdet3d_plugin/models/detectors/petr3d_seg.py, but not I/U that we common used.

This may lead to higher IoU value than that calculated by normal IoU metrics. So why not to use normal IoU metrics?

The source code of the IoU function is shown below:

def IOU (intputs,targets): numerator = 2 * (intputs * targets).sum(dim=1) denominator = intputs.sum(dim=1) + targets.sum(dim=1) loss = (numerator + 0.01) / (denominator + 0.01) return loss

evakasch avatar Aug 22 '22 11:08 evakasch

Thanks for your pointing out this issue. Indeed, there is a silly bug in calculating the IoU metric. We will first update the Readme to remind the users of PETRv2 BEV segmentation. After that, we will fix this issue and update the IoU performances in both the PETR repo and PETRv2 paper on the arxiv. Thanks again for your kind reminder!

vaesl avatar Aug 23 '22 06:08 vaesl