How to get prediction using get_preds in fastai 2?

Hello, I have used Imagedataloader to load the train images and also trained my learner on it, but now i want to get prediction using get_preds() on my test images my test images are in a TEST Folder this folder has 300 mixed images. How to do it using get_preds and also how to set test path data loader.

Thanks!!

1 Like

you can use fastai learner’s add_test() method to replace the learner’s original test set with your data. Alternatively you can also use learn.data.test_dl = new_df to achieve the same and then use get_preds() to get the predictions

Hope you got your answer

1 Like