def compute_iou(bboxA, bboxB):
    """ Computes the intersection over union between two bounding boxes.

    Arguments:
        bboxA, bboxB: Bounding Boxes

    Returns:
        iou (float): intersection over union between bboxA and bboxB
    """
    # find coordinates of intersecting rectangle
    xA = max(bboxA[0], bboxB[0])
    yA = max(bboxA[1], bboxB[1])
    xB = min(bboxA[2], bboxB[2])
    yB = min(bboxA[3], bboxB[3])
    # compute the area of intersection rectangle
    interArea = max(0, xB - xA + 1) * max(0, yB - yA + 1)
    # compute the area of rectangles
    boxAArea = (bboxA[2] - bboxA[0] + 1) * (bboxA[3] - bboxA[1] + 1)
    boxBArea = (bboxB[2] - bboxB[0] + 1) * (bboxB[3] - bboxB[1] + 1)
    return interArea / float(boxAArea + boxBArea - interArea)