def load_frame_counts(fpath):
    """Load mapping from URIs to frame counts from ``fpath``.

    The file is expected to be in the format of a Kaldi ``utt2num_frames`` file;
    that is, two space-delimited columns:

    - URI
    - frame count
    """
    frame_counts = {}
    with open(fpath, 'r') as f:
        for line in f:
            uri, n_frames = line.strip().split()
            n_frames = int(n_frames)
            frame_counts[uri] = n_frames
    return frame_counts