def read_info_file(info_file, include_labels=False):
    """
    It reads an info txt file and returns the list of image paths and, eventually, the list of label paths.
    The info file has an entry in each line in the form: IMAGE_PATH LABEL_PATH.
    :param info_file: the path to the info txt file .
    :param include_labels: if True the list of labels is returned together with the list of images. If False just the
    list of images is returned.
    :return: the list of image paths and the list of label paths (if include_labels is True).
    """

    # open the info file and convert to a list of lines.
    with open(info_file) as f:
        lines = [line.rstrip('\n') for line in f]

    images = []
    labels = []

    # Add each file path to the respective list
    for l in lines:
        images.append(l.split(" ")[0])
        labels.append(l.split(" ")[1])

    if include_labels:
        return images, labels
    else:
        return images