def read_pairs(path):
    """Read path to image and label pairs from file.

    Args:
        path (str): Path to the image-label pair file.

    Returns:
        list of pairs: Each pair type is ``(str, int)``. Which first element is
            a path to image and second element is a label.
    """
    pairs = []
    with open(path) as f:
        for line in f:
            path, label = line.split()
            label = int(label)
            pairs.append((path, label))
    return pairs