tusen-ai / SimpleTrack

MIT License
333 stars 63 forks source link

giou计算问题 #39

Closed ndwmath closed 11 months ago

ndwmath commented 11 months ago

作者你好,在研究您的代码时发现一个问题,在文件simpletrack-main/mot_3d/association.py中计算giou的函数compute_iou_distance调用的是utils,giou(),在计算时应该有点问题,应该是在geometry.py文件里的giou3d函数。 举例来说,假如有: det.x = 0 det.y = 0 det.z = 0 det.h = 2 det.w = 2 det.l = 2 det.o = 0 det.s = 1

trk.x = 0 trk.y = 0 trk.z = 0 trk.h = 1 trk.w = 1 trk.l = 2 trk.o = 0 trk.s = 1 print(utils.giou3d(det, trk)) 正常来说结果应该是I = 2, U = 4, C = 4, giou = 0.25. 但是计算代码结果是I = 3, U = 7, C = 6, giou = 0.59. 这是怎么回事呢,是我理解的有问题吗?期待您的回复。

ndwmath commented 11 months ago

是I = 2, U = 8, C = 8, giou = 0.25……

ziqipang commented 11 months ago

@ndwmath (Using English here because I just made a commit for your issue, and some people might want to read your thread)

Thanks for bringing this to my attention, and what you said is correct!

Specifically, I haven't considered the case when the z-axis of two bounding boxes can include one another. I have fixed this issue right now in the lines of overlap_height and union_height.

As not a lot of bounding boxes in outdoor 3D datasets exhibit this pattern, I think the performance of SimpleTrack won't be significantly affected and I highly encourage you to try the new code.

Thank you again for your help!

ndwmath commented 11 months ago

Thanks for your quick response!