def compute_intersection_over_union(gt_bbox, pred_bbox):
    """ Compute the intersection over union for a ground truth bounding box and a prediction
        bounding box

        Params:
            gt_bbox (RectangleProto): single ground truth bbox
            pred_bbox (RectangleProto): single prediction bbox
        Returns:
            iou_width (double): intersection over union for width dimension
            iou_height (double): intersection over union for height dimension
            iou_area (double): intersection over union area
    """
    intersection_width = min(gt_bbox.max.y, pred_bbox.max.y) - max(gt_bbox.min.y, pred_bbox.min.y)
    intersection_height = min(gt_bbox.max.x, pred_bbox.max.x) - max(gt_bbox.min.x, pred_bbox.min.x)
    intersection_area = intersection_width * intersection_height

    gt_bbox_width = gt_bbox.max.y - gt_bbox.min.y
    gt_bbox_height = gt_bbox.max.x - gt_bbox.min.x
    gt_bbox_area = gt_bbox_width * gt_bbox_height

    pred_bbox_width = pred_bbox.max.y - pred_bbox.min.y
    pred_bbox_height = pred_bbox.max.x - pred_bbox.min.x
    pred_bbox_area = pred_bbox_width * pred_bbox_height

    union_width = gt_bbox_width + pred_bbox_width - intersection_width
    union_height = gt_bbox_height + pred_bbox_height - intersection_height
    union_area = gt_bbox_area + pred_bbox_area - intersection_area

    iou_width = intersection_width / union_width
    iou_height = intersection_height / union_height
    iou_area = intersection_area / union_area

    return iou_width, iou_height, iou_area