Spaces:
No application file
No application file
Upload 2 files
#17
by
matesze41
- opened
- .gitattributes +1 -0
- app.py +10 -0
- model.pkl +3 -0
.gitattributes
CHANGED
@@ -25,3 +25,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
25 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
25 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
model.pkl filter=lfs diff=lfs merge=lfs -text
|
app.py
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
learn = load_learner('model.pkl')
|
2 |
+
|
3 |
+
labels = learn.dls.vocab
|
4 |
+
def predict(img):
|
5 |
+
img = PILImage.create(img)
|
6 |
+
pred,pred_idx,probs = learn.predict(img)
|
7 |
+
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
8 |
+
|
9 |
+
import gradio as gr
|
10 |
+
gr.Interface(fn=predict, inputs=gr.inputs.Image(shape=(512, 512)), outputs=gr.outputs.Label(num_top_classes=3)).launch(share=True)
|
model.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:19f2b05ec78754a25260cd6eed0c0933de1fe1e4513396d33328c278a9bc9b0a
|
3 |
+
size 46978822
|