Spaces:
Runtime error
Runtime error
bonosa commited on
Commit Β·
6db3fcd
1
Parent(s): d7b52a6
work damn you!
Browse files- app.py +17 -0
- export1.pkl +3 -0
- required.txt +1 -0
app.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import fastbook
|
| 2 |
+
fastbook.setup_book()
|
| 3 |
+
#hide
|
| 4 |
+
from fastbook import *
|
| 5 |
+
from fastai.vision.widgets import *
|
| 6 |
+
import gradio as gr
|
| 7 |
+
# 4. Create a Gradio interface
|
| 8 |
+
def predict_parrot_species(image):
|
| 9 |
+
learn_inf = load_learner('export1.pkl')
|
| 10 |
+
pred, _, _ = learn_inf.predict(image)
|
| 11 |
+
return pred
|
| 12 |
+
|
| 13 |
+
input_image = gr.inputs.Image(shape=(224, 224))
|
| 14 |
+
output_label = gr.outputs.Label()
|
| 15 |
+
|
| 16 |
+
gr_interface = gr.Interface(fn=predict_parrot_species, inputs=input_image, outputs=output_label)
|
| 17 |
+
gr_interface = gr.Interface(fn=predict_parrot_species, inputs=input_image, outputs=output_label)
|
export1.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:236de039efdf3d5c8a71538ed5d86925818bb3b257bca9444657791a9d4f2110
|
| 3 |
+
size 46978319
|
required.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
fastcore
|