def calculateIoU(startX_, startY_, endX_, endY_, x1, y1, x2, y2):
    """
    Calculate the intersection over union (IoU) score for two bounding boxes.
    :param startX_: Upper left x coordinate of the first object detection.
    :param startY_: Upper left y coordinate of the first object detection.
    :param endX_: Lower right x coordinate of the first object detection.
    :param endY_: Lower right y coordinate of the first object detection.
    :param x1: Upper left x coordinate of the second object detection.
    :param y1: Upper left y coordinate of the second object detection.
    :param x2: Lower right x coordinate of the second object detection.
    :param y2: Lower right y coordinate of the second object detection.
    """
    
    x_left = max(startX_, x1);
    y_top = max(startY_, y1);
    x_right = min(endX_, x2);
    y_bottom = min(endY_, y2);

    if x_right < x_left or y_bottom < y_top:
        return 0.0

    intersection_area = (x_right - x_left) * (y_bottom - y_top);
    bb1_area = (endX_ - startX_) * (endY_ - startY_);
    bb2_area = (x2 - x1) * (y2 - y1);
    iou = intersection_area / (bb1_area + bb2_area - intersection_area);
    return iou