text_plain_output_1.png
import pathlib

import random

main_path = pathlib.Path('../input/oct2017/OCT2017 ')
train_path = main_path / 'train'
test_path = main_path / 'test'
val_path = main_path / 'val'
train_path

import random
train_image_paths = [str(path) for path in list(train_path.glob('*/*.jpeg'))]
random.shuffle(train_image_paths)
test_image_paths = [str(path) for path in list(test_path.glob('*/*.jpeg'))]
val_image_paths = [str(path) for path in list(val_path.glob('*/*.jpeg'))]

label_names = sorted(set((item.name for item in train_path.glob('*') if item.is_dir())))
label_to_index = dict(((name, index) for index, name in enumerate(label_names)))
label_to_index