def APs2mAP(aps):
    """
    Take a mean of APs over all classes to compute mAP
    """
    num_classes = 0.
    sum_ap = 0.
    for _, v in aps.items():
        sum_ap += v
        num_classes += 1

    if num_classes == 0:
        return 0
    return sum_ap/num_classes