Let us say that I have two models: model1 and model2. Both of them have been trained on the same set of images, the difference is that they are classifying mutually exclusive things in the image. Now, after training, can I use model1 and model2 for inference and have the test images in a common directory?
Based on my simple test, data = ImageClassifierData.from_paths(PATH, bs=bs, tfms=tfms, num_workers=1, test_name=test_dir) requires the PATH to contain the train directory as well. Since both the models have different functions, having a common train directory isn’t possible.
I’m not an expert on the fastai library, but if you’re on Linux you could make a symlink from model2’s test directory to that from model1. Then model2 will load the exact same images as model1 for testing.
what do you mean by as “as they come”?:
classifying another set of images(other datasets), or
classifying incrementally single image one after another.
For the 1st, there is a method set_data that receive a data object like the one you wrote on you 1st post. So you must just set the test_name the folder containing images to classify.
For the 2nd, you can refer to this post:
Hopefully it helps.
Let us know if you get some troubles.