megvii-research / PETR

[ECCV2022] PETR: Position Embedding Transformation for Multi-View 3D Object Detection & [ICCV2023] PETRv2: A Unified Framework for 3D Perception from Multi-Camera Images
Other
868 stars 132 forks source link

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

Open evakasch opened 2 years ago

evakasch commented 2 years ago

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

vaesl commented 2 years ago

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!