Spaces:
Runtime error
Runtime error
Clint Miller commited on
Commit ·
bd26756
1
Parent(s): 9185348
added title, description, and examples
Browse files
app.py
CHANGED
|
@@ -3,10 +3,14 @@ import gradio as gr
|
|
| 3 |
import skimage
|
| 4 |
|
| 5 |
learn = load_learner('export.pkl')
|
|
|
|
| 6 |
labels = learn.dls.vocab
|
| 7 |
def predict(img):
|
| 8 |
pred,pred_idx,probs = learn.predict(img)
|
| 9 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
| 10 |
|
|
|
|
|
|
|
|
|
|
| 11 |
enable_queue=True
|
| 12 |
-
gr.Interface(fn=predict, inputs=gr.inputs.Image(shape=(512, 512)), outputs=gr.outputs.Label(num_top_classes=3),enable_queue=enable_queue).launch()
|
|
|
|
| 3 |
import skimage
|
| 4 |
|
| 5 |
learn = load_learner('export.pkl')
|
| 6 |
+
|
| 7 |
labels = learn.dls.vocab
|
| 8 |
def predict(img):
|
| 9 |
pred,pred_idx,probs = learn.predict(img)
|
| 10 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
| 11 |
|
| 12 |
+
title = "Pet Breed Classifier"
|
| 13 |
+
description = "A pet breed classifier from Tanishq's tutorial"
|
| 14 |
+
examples = ['mainecoon.jpg','retriever.webp']
|
| 15 |
enable_queue=True
|
| 16 |
+
gr.Interface(fn=predict, inputs=gr.inputs.Image(shape=(512, 512)), outputs=gr.outputs.Label(num_top_classes=3),title=title,description=description,examples=examples,enable_queue=enable_queue).launch()
|