Boxes are [x1, y1, x2, y2] with x1 < x2, y1 < y2.
[x1, y1, x2, y2]
x1 < x2
y1 < y2
Implement iou(a, b) and giou(a, b) for arrays of boxes of shape (N, 4) paired row by row, returning arrays of shape (N,).
iou(a, b)
giou(a, b)
(N, 4)
(N,)