Spaces:
Build error
Build error
JP Hwang
commited on
Commit
·
8e333aa
1
Parent(s):
2f27cb3
disable share in gradio
Browse files- app.py +3 -2
- requirements.txt +0 -1
app.py
CHANGED
@@ -1,5 +1,7 @@
|
|
|
|
1 |
from fastai.vision.all import *
|
2 |
from fastcore import *
|
|
|
3 |
learn = load_learner('architecture.pkl')
|
4 |
labels = learn.dls.vocab
|
5 |
|
@@ -8,9 +10,8 @@ def predict(imgpath):
|
|
8 |
pred, pred_idx, probs = learn.predict(img)
|
9 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
10 |
|
11 |
-
import gradio as gr
|
12 |
gr.Interface(
|
13 |
fn=predict,
|
14 |
inputs=gr.inputs.Image(shape=(512, 512)),
|
15 |
outputs=gr.outputs.Label(num_top_classes=3)
|
16 |
-
).launch(
|
|
|
1 |
+
import gradio as gr
|
2 |
from fastai.vision.all import *
|
3 |
from fastcore import *
|
4 |
+
|
5 |
learn = load_learner('architecture.pkl')
|
6 |
labels = learn.dls.vocab
|
7 |
|
|
|
10 |
pred, pred_idx, probs = learn.predict(img)
|
11 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
12 |
|
|
|
13 |
gr.Interface(
|
14 |
fn=predict,
|
15 |
inputs=gr.inputs.Image(shape=(512, 512)),
|
16 |
outputs=gr.outputs.Label(num_top_classes=3)
|
17 |
+
).launch()
|
requirements.txt
CHANGED
@@ -1,2 +1 @@
|
|
1 |
fastai
|
2 |
-
gradio
|
|
|
1 |
fastai
|
|