This repository provides an implementation of polygons intersection and evaluation of differenciable IoU in PyTorch. This functionality can be used to construct loss for rotated bounding boxes
The algorithm is based on lines intersections and assumes convex polygons which is the case for rotated object detection (or polygons detection).
Note: polygons intersection is not yet heavily tested. There can be some bugs and edge cases. Please feel free to let me know about them
Below is the demo image which shows algorithm work for different cases. In addition, standard IoU for boxes which are parallel to coordinate axes is computed
Below is the list of other repositories which might be useful when dealing with rotated object detection loss: