Spaces:
Runtime error
Runtime error
Commit
·
24a72eb
1
Parent(s):
cd7d646
Init commit 2
Browse files- .gitattributes +1 -0
- app.py +15 -0
- convnext_small.pkl +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
convnext_small.pkl filter=lfs diff=lfs merge=lfs -text
|
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
|
4 |
+
def predict(img):
|
5 |
+
learn = load_learner("convnext_small.pkl")
|
6 |
+
img = PILImage.create(img)
|
7 |
+
learn.predict(image)
|
8 |
+
pred, pred_idx, probs = learn.predict(img)
|
9 |
+
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
10 |
+
|
11 |
+
|
12 |
+
iface = gr.Interface(fn=predict,
|
13 |
+
inputs=gr.inputs.Image(shape=(224, 224)),
|
14 |
+
outputs=gr.outputs.Label(num_top_classes=3))
|
15 |
+
iface.launch(share=True)
|
convnext_small.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6040cfb0ab9552d451761aa886023d95153ec20a6d1d37a08b4125ab719c9dba
|
3 |
+
size 201353077
|