Spaces:
Runtime error
Runtime error
from fastai.vision.all import * | |
#Windows fix | |
import pathlib | |
temp = pathlib.PosixPath | |
pathlib.PosixPath = pathlib.WindowsPath | |
learn = load_learner('SaudiLandmarkClassifier.pkl') | |
def predict(input): | |
# image = gr.Image(height=224,type="pil",image_obj=input) | |
image = PILImage.create(input).resize((224,224)) | |
results = learn.predict(image)[0] | |
return results | |
iface = gr.Interface(fn=predict, inputs="image", outputs="text", examples=['Examples\A.png', 'Examples\B.png', 'Examples\C.png']) | |
iface.launch() |