Is there an easy way to use an image test set with labels as well? I am trying to use
test_dl()
so that the validation transforms are applied to the test set but I cannot figure out a way to include the labels. Currently I am manually extracting them as shown below
# construct the test data loader test_items = get_image_files(path_to_test_set) test_dl_ = test_dl(dbunch_val, test_items)
# manually extract the labels for the test set y_labels = L(map(parent_label,test_items)) _,o2i = uniqueify(y_labels, sort=True, bidir=True) y = torch.from_numpy(np.array(L(map(o2i.get,y_labels))))
# check the accuracy preds = learn.get_preds(dl=test_dl_) accuracy(preds[0],y)