def fixIoU(bb1, bb2):
    """
    Calculate the fix Intersection over Union (IoU) of two bounding boxes.
    
    fixiou = intersection_area / min(bb1_area, bb2_area)

    Parameters
    ----------
    bb1 : set
        Keys: ('x1', 'y1', 'x2', 'y2')
        The (x1, y1) position is at the top left corner,
        the (x2, y2) position is at the bottom right corner
    bb2 : set
        Keys: ('x1', 'y1', 'x2', 'y2')

    Returns
    -------
    float
        in [0, 1]
    """
    assert bb1[0] < bb1[2] and bb1[1] < bb1[3], print(bb1)
    assert bb2[0] < bb2[2] and bb2[1] < bb2[3], print(bb2)

    # determine the coordinates of the intersection rectangle
    x_left = max(bb1[0], bb2[0]);  y_top = max(bb1[1], bb2[1])
    x_right = min(bb1[2], bb2[2]); y_bottom = min(bb1[3], bb2[3])
    if x_right < x_left or y_bottom < y_top: return 0.0

    # The intersection of two axis-aligned bounding boxes is always an
    # axis-aligned bounding box
    intersection_area = (x_right - x_left) * (y_bottom - y_top)
    # compute the area of both AABBs
    bb1_area = (bb1[2] - bb1[0]) * (bb1[3] - bb1[1])
    bb2_area = (bb2[2] - bb2[0]) * (bb2[3] - bb2[1])
    # compute the fix intersection over union by taking the intersection
    fixiou = intersection_area / min(bb1_area, bb2_area)
    assert fixiou >= 0.0 and fixiou <= 1.0
    return fixiou