gvlachos's picture
initial commit
30b9034
raw
history blame
762 Bytes
import gradio as gr
from fastai.vision.all import *
import skimage
learn = load_learner("export.pkl")
def predict(img):
img = PILImage.create(img)
pred, pred_idx, probs = learn.predict(img)
result = f"Prediction: {pred}; Probability: {probs[pred_idx]:.04f}"
return result
gr.Interface(
fn=predict,
inputs=gr.inputs.Image(shape=(512, 512)),
outputs=gr.outputs.Label(num_top_classes=3),
title="Saving the silkies",
description="A pigeon/silkie classifier. Create as a demo for entertainment and educational purposes.",
article="<p style='text-align: center'><a href='LINK_HERE' target='_blank'>Blog post</a></p>",
examples=["IMG_3558.jpg"],
interpretation="default",
enable_queue=True,
).launch(share=True)