tensorflow / addons

Useful extra functionality for TensorFlow 2.x maintained by SIG-addons
Apache License 2.0
1.69k stars 610 forks source link

`tfa.losses.GIoULoss` docs not clear about input format #2846

Closed VachanVY closed 5 months ago

VachanVY commented 1 year ago

The bounding box input format is unclear in GIoULoss. Please include in which format the boxes should be in the docs.

As per the source code

Args: y_true: true targets tensor. The coordinates of the each bounding box in boxes are encoded as [y_min, x_min, y_max, x_max]. y_pred: predictions tensor. The coordinates of the each bounding box in boxes are encoded as [y_min, x_min, y_max, x_max]. mode: one of ['giou', 'iou'], decided to calculate GIoU or IoU loss.

include the above in docs

coder-amey commented 10 months ago

I am stuck here as well. The source code implies that the designated format is min-max, with y before x, which is quite unusual. With addons getting deprecated, I am not certain if we will obtain any clarity on this.

VachanVY commented 9 months ago

@coder-amey In many keras tutorials, they use box util functions like swap_xy, may be that's a Tensorflow-keras thing. Go according to the source code.