Spaces:
Runtime error
Runtime error
app
Browse files
app.py
CHANGED
@@ -1,5 +1,15 @@
|
|
1 |
-
import
|
2 |
-
from
|
3 |
|
4 |
-
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from fastai import *
|
3 |
|
4 |
+
learner_inf = load_learner('baltrishkes.pkl')
|
5 |
|
6 |
+
def predict(img):
|
7 |
+
img = PILImage.create(img)
|
8 |
+
pred,pred_idx,probs = learner_inf.predict(img)
|
9 |
+
return pred
|
10 |
+
|
11 |
+
|
12 |
+
gr.Interface(fn=predict,
|
13 |
+
inputs=gr.inputs.Image(shape=(512, 512)),
|
14 |
+
outputs=gr.outputs.Label(),
|
15 |
+
interpretation="default").launch()
|