Intersection over Union
Self-study exercise. Checking on the site is not available yet. Write and download a solution to work on your computer.
Finish iou(a, b). Boxes are [x1, y1, x2, y2] (or a batch (N, 4)).
, where the intersection is the
non-negative overlap area and the union is the sum of areas minus the
intersection. Return 0 when the union is zero. Use NumPy.