-
Couldn't load subscription status.
- Fork 19.6k
Description
Describe the bug
In the current implementation of v in compute_ciou function (keras/src/layers/preprocessing/image_preprocessing/bounding_boxes/iou.py), the (4 / math.pi**2) term is included inside power and so gets squared together with the arctan term.
v = ops.squeeze(
ops.power(
(4 / math.pi**2)
* (ops.arctan(width_2 / height_2) - ops.arctan(width_1 / height_1)),
2,
),
axis=-1,
)
However, according to equation (8) in the original CIoU paper, (4 / math.pi**2) should NOT be squared (i.e., it should be outside the power op) - only the arctan term should be squared. This is correctly reflected in Ultralytics' implementation of CIoU here.