Image Classifier from csv

Hi all,

I am trying to use ImageClassifierData.from_csv. I have a folder with train and validation images and a label_csv file that contains the labels for the train and validation. I also have a test file with images, and I used the option to indicate the test folder. However, when I try to predict with learn.TTA(is_test=True), how (where) can I inform the labels of the test set?
Thank you so much

Hi,

when you train from CSV, all your images must be in the same folder, there is no more Train and Valid folders. The labels of the images are contained in the .csv file, first column is image file name without extension, then second column is label.

As for your question, if i understand correctly, we don’t give labels for the test set. The system returns the prediction only.

Dear Hugues, thanks for replying. I actually got the training/validation right, so I just have them in one folder. For the test set, after I can get the predictions, how can I know the order of them so I can relate it back to the actual observations? To clarify:
After I run preds = learn.TTA(is_test=True), I will get the predictions. However, they are in a particular order which does not seem to be the alphabetical order of the image files in the dataset. I want to be able to know which prediction corresponds to which image file so I can check accuracy.

Sorry of this seems to be a basic question.

Thank you

You can check the fnames list. data.test_ds.fnames gives the required list

Thank you!!!