| import os | |
| from PIL import Image | |
| def load_dataset(dataset_path="asl_dataset"): | |
| mapping = {} | |
| for letter in sorted(os.listdir(dataset_path)): | |
| letter_path = os.path.join(dataset_path, letter) | |
| if not os.path.isdir(letter_path): | |
| continue | |
| for img_file in os.listdir(letter_path): | |
| img_path = os.path.join(letter_path, img_file) | |
| mapping[img_file] = letter | |
| return mapping | |
| image_labels = load_dataset() | |