The code below creates a classifier from MNIST data set for 3 and 7 image digits. Can you help me figure out how to use this learner to classify a new image?
!pip install -Uqq fastbook
import fastbook
fastbook.setup_book()
from fastai.vision.all import *
from fastbook import *
matplotlib.rc('image', cmap='Greys')
path = untar_data(URLs.MNIST_SAMPLE)
dls = ImageDataLoaders.from_folder(path)
learn=cnn_learner(dls,resnet18,pretrained=False,loss_func=F.cross_entropy,metrics = accuracy)
learn.fit_one_cycle(1,0.1)
Just use
learn.predict('testImage.jpg')
For your reference, see the fastai docs vision tutorial