import logging


def load_image_pairs(text_file: str):
    """Load image pairs from text file.
    Args:
        * text_file: Text file containing the list of image IDs.
    Returns:
        * images: The list of all unique images.
        * pairs: The list of image pairs.
    """
    with open(text_file, "r") as handle:
        images = [x.rstrip() for x in handle.readlines()]
        pairs = [x.split(",") for x in images]
        images = list(set([item for sublist in pairs for item in sublist]))

    logging.info(f"Found {len(images)} unique images, and {len(pairs)} image pairs.")
    return images, pairs