Spaces:
Runtime error
Runtime error
voidKandy commited on
Commit ·
65ff3e1
1
Parent(s): 4ef9961
LETS GOO
Browse files
.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
app.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastai.vision.all import *
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
learn_inf = load_learner('export.pkl')
|
| 5 |
+
categories = ('radiohead', 'voidkandy', 'king_gizzard')
|
| 6 |
+
def classify_specs(img):
|
| 7 |
+
pred, idx, probs = learn_inf.predict(img)
|
| 8 |
+
return dict(zip(categories, map(float,probs)))
|
| 9 |
+
image = gr.inputs.Image(shape=(192,192))
|
| 10 |
+
label = gr.outputs.Label()
|
| 11 |
+
|
| 12 |
+
intf = gr.Interface(fn=classify_specs, inputs=image, outputs=label)
|
| 13 |
+
intf.launch(inline=False)
|