Hi, I’m trying to start my first pytorch project from a Kaggle Dataset, the goal is to simply classify some images.
So far I’ve managed to use ImageFolder to use my own Dataset but it lacks the labels of all images.
The issue lies here: The dataset by itself contains 2 folders Train and Test.

Inside Train there are 26684 images.
Inside Test there are 3000 images.
And there’s a csv file with two columns File name and Class, this csv matches the image with it’s corresponding label. (There are only 3 different classes for all the images)

I’ve tried to find some tutorials on internet on how to handle this, but so far all responses available are related to organize my images into a folder structure like this:

root/dog/xxx.png
root/dog/xxy.png
root/dog/xxz.png
root/cat/123.png
root/cat/nsdf3.png
root/cat/asd932_.png

But thinking in a more real life example, I thought that there must be a way of avoiding me classifying my own images into subfolders if there’s already a reference file for the computer to do this by it’s own.
So I’m sure I’m missing something, could any please help me on how would you do this?
I’ve published my progress on github on the following link Pneumonia_Kevin 7