maudzung / RTM3D

Unofficial PyTorch implementation of "RTM3D: Real-time Monocular 3D Detection from Object Keypoints for Autonomous Driving" (ECCV 2020)
https://arxiv.org/pdf/2001.03343.pdf
MIT License
291 stars 63 forks source link

About a fix in "compute_radius" (kitti_data_utils.py) #10

Open Owen-Liuyuxuan opened 3 years ago

Owen-Liuyuxuan commented 3 years ago

There is an old problem of mis-implementation of the CornetNet. And "has been fixed" in CenterNet https://github.com/Duankaiwen/CenterNet/issues/47.

This repo, by default, makes ground truth heatmap following CenterNet who follows CornerNet.

I have not thoroughly tested the performance because of hardware limitations. But a possible fix could be?:

def compute_radius(det_size, min_overlap=0.7):
    height, width = det_size

    a2 = 4
    b2 = 2 * (height + width)
    c2 = (1 - min_overlap) * width * height
    sq2 = np.sqrt(b2 ** 2 - 4 * a2 * c2)
    r2 = (b2 - sq2) / (2 * a2)

    return r2

I would also point out that this will not necessarily give better performance. Because the original idea from CornerNet does not necessarily transfer well to RTM3D here.

maudzung commented 3 years ago

Thanks @Owen-Liuyuxuan I'll check your suggestion.