Spaces:
Runtime error
Runtime error
bonosa commited on
Commit Β·
ec61e8d
1
Parent(s): b94c896
work damn you!
Browse files
app.py
CHANGED
|
@@ -1,14 +1,18 @@
|
|
| 1 |
|
| 2 |
from fastai.vision.all import *
|
| 3 |
-
import gradio
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
# 4. Create a Gradio interface
|
| 5 |
def predict_parrot_species(image):
|
| 6 |
learn_inf = load_learner('export1.pkl')
|
| 7 |
pred, _, _ = learn_inf.predict(image)
|
| 8 |
return pred
|
| 9 |
|
| 10 |
-
input_image =
|
| 11 |
-
output_label =
|
| 12 |
|
| 13 |
-
gr_interface =
|
| 14 |
-
gr_interface =
|
|
|
|
| 1 |
|
| 2 |
from fastai.vision.all import *
|
| 3 |
+
import gradio
|
| 4 |
+
from gradio.inputs import *
|
| 5 |
+
from gradio.outputs import *
|
| 6 |
+
from gradio import Interface, File
|
| 7 |
+
|
| 8 |
# 4. Create a Gradio interface
|
| 9 |
def predict_parrot_species(image):
|
| 10 |
learn_inf = load_learner('export1.pkl')
|
| 11 |
pred, _, _ = learn_inf.predict(image)
|
| 12 |
return pred
|
| 13 |
|
| 14 |
+
input_image = gradio.inputs.Image(shape=(224, 224))
|
| 15 |
+
output_label = gradio.outputs.Label()
|
| 16 |
|
| 17 |
+
gr_interface = gradio.Interface(fn=predict_parrot_species, inputs=input_image, outputs=output_label)
|
| 18 |
+
gr_interface = gradio.Interface(fn=predict_parrot_species, inputs=input_image, outputs=output_label)
|