I created this dataset from a path:
real_data = ImageDataBunch.from_folder(path, ds_tfms=get_transforms(do_flip=False),
bs=bs,size=sz,train='TRAINSTAM_100img',test='REAL_DATA_TEST_CROPPED',resize_method=ResizeMethod.SQUISH)
In REAL_DATA_TEST_CROPPED, I have 11 images
I created and trained a learner, and ran TTA over my testset
pred_test_TTA, y_test_TTA = learn_for_real_data.TTA(ds_type=DatasetType.Test)
classes_real=np.argmax(pred_test, axis=1)
that gives me the following tensor of classes ID for my test set
tensor([1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1])
How can I know the filenames order in the test dataset so that I can know which images from the test set have class 0, and which have class 1?
I have seen in the forum I could you
real_data.test_dl.dataset.x
but it just gives me
ImageList (11 items)
Image (3, 47, 111),Image (3, 46, 109),Image (3, 75, 148),Image (3, 36, 125),Image (3, 69, 140)
Path: /Data/PROJECTS/Private/classifier_k/DATA/10K_SETS
I want the filenames and don’t know how to get it.
I have also seen answers with.fnames
, but not working in my case.
Any help would be appreciated.