Hi ptrblck
Thanks for your reply. I would like to utilize the existing functionality of the original ImageFolder dataset as much as I can  so that I can easily read labels and apply torchvision.transforms later on.
I look at the source code of ImageFolder 7. The main problem is that there is a parameter called 'IMG_EXTENSIONS which lists the extensions wth which the file will be loaded by the default image loader. Any file with an extension not listed in this list will be ignored during loading.
IMG_EXTENSIONS = [
    '.jpg', '.JPG', '.jpeg', '.JPEG',
    '.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP',
]

Is there any way I can just reset this parameter and reserve the other functionality of the ‘ImageFolder’ class?