This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Tuple | |
def intersection_over_union(boxA: Tuple[float, float, float, float], boxB: Tuple[float, float, float, float]) -> float: | |
"""Calculates the intersection of union between two rectangles/bounding boxes. | |
See https://www.pyimagesearch.com/2016/11/07/intersection-over-union-iou-for-object-detection/ for more information about IOU. | |
Args: | |
boxA: First bounding box with coordinates in the format [xmin, ymin, xmax, ymax]. |