# Define loader function def custom_loader(path): with open(path, 'rb') as f: img = Image.open(f) img = img.crop((50, 60, 750, 460)) #Size: 700x400 px img.load() return img # Path of images (local to accelerate loading) path = "data/Coil_Vision/01_train_val_test"