def compute_scale_error(gt_dimension, dt_dimension):
    """
    This method compares predictions to the ground truth in terms of scale.
    It is equivalent to intersection over union (IOU) between the two boxes in 3D,
    if we assume that the boxes are aligned, i.e. translation and rotation are considered identical.

    Parameters
    ----------
    gt_dimension: List[float]
        GT annotation sample.
    dt_dimension: List[float]
        Predicted sample.

    Returns: float
    ----------
        Scale IOU.
    """

    # Compute IOU.
    min_wlh = [
        min(gt_dimension[0], dt_dimension[0]),
        min(gt_dimension[1], dt_dimension[1]),
        min(gt_dimension[2], dt_dimension[2])
    ]
    volume_gt = gt_dimension[0] * gt_dimension[1] * gt_dimension[2]
    volume_dt = dt_dimension[0] * dt_dimension[1] * dt_dimension[2]
    intersection = min_wlh[0] * min_wlh[1] * min_wlh[2]
    union = volume_gt + volume_dt - intersection
    iou = intersection / union

    return iou

    This method compares predictions to the ground truth in terms of scale.
    It is equivalent to intersection over union (IOU) between the two boxes in 3D,
    if we assume that the boxes are aligned, i.e. translation and rotation are considered identical.

    Parameters
    ----------
    gt_dimension: List[float]
        GT annotation sample.
    dt_dimension: List[float]
        Predicted sample.

    Returns: float
    ----------
        Scale IOU.
    
tridet/evaluators/kitti_3d_evaluator.py