Spaces:
Build error
Build error
Asis commited on
Commit ·
cd4cbfc
1
Parent(s): 8fd12e4
Create app
Browse files1233445676789101112131415from fastai.vision.all import *import gradio as gr
def greet(name): return "Hello " + name + "!!"learn = load_learner('model.pkl')
iface = gr.Interface(fn=greet, inputs="text", outputs="text")iface.launch()labels = learn.dls.vocabdef predict(img): img = PILImage.create(img) pred,pred_idx,probs = learn.predict(img) return {labels[i]: float(probs[i]) for i in range(len(labels))}
title = "Empty PLate Classifier"description = "We are passionate about the emptiness of plates, but it is often rather challenging to determine whether a plate is empty or not. This model will help you in that task!"
gr.Interface(fn=predict, inputs=gr.inputs.Image(shape=(512, 512)), outputs=gr.outputs.Label(num_top_classes=3)).launch(share=True)app.py+12-4