I have images dataset in two different directories Train_images
and Test_images
. Both directories are organized the same way where images are inside another directory with their associated label.
I am loading the images into train_dataset = datasets.ImageFolder(root='path/to/dataset/Train_images')
and test_dataset = datasets.ImageFolder(root='path/to/dataset/Test_images')
. I wanted to know if ImageFolder sort the directories before loading them for consistency or does some smart way for making sure that labels will be the same from the two different folders. If this is not the case, would you help me understand how the function ImageFolder
work.