Muhammad Abdullahi
added the main code and the model files
77f2493
raw
history blame
638 Bytes
import gradio as gr
from fastai import load_learner
learner = load_learner('model.pkl')
def classify_images(img):
pred, index, probs = learner.predict(img)
return {learner.dls.vocab[i]: float(probs[i]) for i in range(len(learner.dls.vocab))}
intface = gr.Interface(fn=classify_images, inputs=gr.inputs.Image(type='pil'),
outputs=gr.outputs.Label(num_top_classes=2),
title="Kentish plover vs White-faced plover Classifier",
description="Upload an image of either Kentish plover and White-faced plover."
)
intface.launch(share=True)