Description
🚀 The feature
Currently losses such as cIoU, dIoU and gIoU reimplement functions that exist already on boxes ops. In addition they contain a lot of duplicate code that can be shared. Finally the testing strategy can be improved.
This ticket is about:
- Investigating ways to re-use code on Losses from boxes. This should happen without affecting the speed (See use generalised_box_iou function to calculate giou_loss #5877 (comment)).
- Reduce the amount of code duplication between methods gIoU/dIoU/cIoU boxes and losses
- Align the testing strategy between the different similar methods and incorporate the comments at Distance IoU #5786 (comment)
cc @oke-aditya