Inference using local data


#1

Ok I know is stupid, but in fact I’m learning by doing instead of following the course, having a single goal in mind so image categorization and object recognition.

Finished to adapt this example using my data for face recognition

Now trained my model (with currently not so good results, but I’m also experimenting with image format, memory occupation etc) I want to predict on a new image that is not inside the train and validation dataset.

Using fastai documentation is supposed to use something like this

img = learner.data.train_ds[0][0]
learner.predict(img)

Of course I want the img coming from my file system and not from the created data class, so loading i.e. /newtest/child.jpg

Reading the forum I find a lot of examples for deploying i.e. on Render or prediction using thousand of local images…this is simpler.