def make_val_split(data_folder):
    """
    Splits the Images in train and test.
    Assumes a File all.txt in data_folder.
    """

    all_file = "all.txt"
    train_file = "train.txt"
    test_file = "val.txt"
    test_num = 20

    filename = os.path.join(data_folder, all_file)
    assert os.path.exists(filename), ("File not Found %s"
                                      % filename)

    files = [line for line in open(filename)]

    shuffle(files)

    train = files[:-test_num]
    test = files[-test_num:]

    train_file = os.path.join(data_folder, train_file)
    test_file = os.path.join(data_folder, test_file)

    with open(train_file, 'w') as file:
        for label in train:
            file.write(label)

    with open(test_file, 'w') as file:
        for label in test:
            file.write(label)

    Splits the Images in train and test.
    Assumes a File all.txt in data_folder.
    
data/prepare_data.py