gluon-cv
gluon-cv copied to clipboard
Error in calculating bbox_iou
https://github.com/dmlc/gluon-cv/blob/master/gluoncv/utils/bbox.py#L30
Seems
area_a = np.prod(bbox_a[:, 2:4] - bbox_a[:, :2], axis=1)
should be:
area_a = np.prod(bbox_a[:, 2:4] - bbox_a[:, :2] + 1, axis=1)
see https://github.com/dmlc/gluon-cv/pull/186 whether adding 1px is still debating and not valid if box is normalized, but I've added an option to allow such convention.
For an image of size (h, w, c) = (300, 400, 3), the maximum box (xmin, ymin, xmax, ymax) is (0, 0, 399, 299) if represented in integer box and (0.0, 0.0, 400.0, 300.0) if represented floating point box. Adding 1px is used for integer box but not for floating point box. Such usage can be verified with segmentation annotation.