COCO2YOLO
COCO2YOLO copied to clipboard
if bbox is tlbr, _bbox_2_yolo code is need to update
When bbox is tlbr, the result value is not accurate when using the existing calculation code. I may be wrong, but it looks like the calculation code needs to be corrected.
x = (bbox[0] + bbox[1]) / 2. y = (bbox[1] + bbox[3]) / 2. w = bbox[2] - bbox[0] h = bbox[3] - bbox[1] x = x / img_w y = y / img_h w = w / img_w h = h / img_h return x, y, w, h