def parse_truth(truth):
    """
    Parse the ground truth file, mapping each frame to the
    number of people in it.
    :param truth: Path to the truth file.
    :return: A dict mapping keys to the true number of people contained in it.
    """
    frame_to_count = dict()
    with open(truth, "r") as file:
        for line in file:
            frame, id, posx, posy = line.split(',')
            frame = int(frame)
            frame_to_count[frame] = frame_to_count.get(frame, 0) + 1
    return frame_to_count