The XYWH format specifies the bounding box by the top-left corner coordinates (X, Y) and the width (W) and height (H) of the box.
box_xywh = [50, 30, 100, 200] box_xyxy = [box_xywh[0], box_xywh[1], box_xywh[0] + box_xywh[2], box_xywh[1] + box_xywh[3]] print(box_xyxy)
The bottom-right corner is calculated by adding width to x and height to y, so (50+100, 30+200) = (150, 230).
Center coordinates with width and height are continuous and easier for regression, making them suitable for neural network outputs.
IoU is the ratio of the overlapping area to the combined area of both boxes. A score of 0.75 means 75% overlap.
The code incorrectly divides x-coordinates by image height (100) and y-coordinates by image width (200). X-coordinates should be divided by image width (200), and y-coordinates by image height (100).
