The original implementation has been strange following this idea. Because empirically and theoretically, the only possible way to have the smallest IoU with the original bbox is (w - 2r) (h - 2r). The corresponding equation is (w - 2r)(h-2r) / wh = min_iou. which yields the coefficients of r2 in "compute_radius". No "min(r1, r2, r3)" is actually needed. The fix minimizes the code changes and does not try to further fix this one.
The quadratic equation has two solution, one is that (w-2r) < 0 && (h-2r) < 0 the other is (w-2r) >0 && (h-2r) >0. The latter one is what we need. It always corresponds to the solution (b2 - sq2) / (2 * a2), while the first solution is r with larger magnitude -> (b2+sq2) / (2*a2). This has been fixed.
I have not thoroughly tested the performance because of hardware limitations. But a possible fix could be?:
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.
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?:
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.