Spaces:
Runtime error
Runtime error
initial commit
Browse files- .gitattributes +9 -0
- app.py +21 -0
- clean-01.JPG +3 -0
- clean-02.JPG +3 -0
- clean-03.JPG +3 -0
- clean-04.JPG +3 -0
- dirty-01.JPG +3 -0
- dirty-02.JPG +3 -0
- dirty-03.JPG +3 -0
- dirty-04.JPG +3 -0
- requirements.txt +2 -0
- seiba-edisa-apple-bins.pkl +3 -0
.gitattributes
CHANGED
@@ -32,3 +32,12 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
35 |
+
clean-02.JPG filter=lfs diff=lfs merge=lfs -text
|
36 |
+
clean-03.JPG filter=lfs diff=lfs merge=lfs -text
|
37 |
+
dirty-02.JPG filter=lfs diff=lfs merge=lfs -text
|
38 |
+
dirty-03.JPG filter=lfs diff=lfs merge=lfs -text
|
39 |
+
seiba-edisa-apple-bins.pkl filter=lfs diff=lfs merge=lfs -text
|
40 |
+
clean-01.JPG filter=lfs diff=lfs merge=lfs -text
|
41 |
+
clean-04.JPG filter=lfs diff=lfs merge=lfs -text
|
42 |
+
dirty-01.JPG filter=lfs diff=lfs merge=lfs -text
|
43 |
+
dirty-04.JPG filter=lfs diff=lfs merge=lfs -text
|
app.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from fastai.vision.all import *
|
3 |
+
|
4 |
+
learn = load_learner('seiba-edisa-apple-bins.pkl')
|
5 |
+
|
6 |
+
categories = ['Clean', 'Dirty']
|
7 |
+
def predict(img):
|
8 |
+
# img = PILImage.create(img)
|
9 |
+
_,_,probs = learn.predict(img)
|
10 |
+
return dict(zip(categories, map(float,probs)))
|
11 |
+
|
12 |
+
title = "Apple bins classifier"
|
13 |
+
examples = ['clean-01.JPG','clean-02.JPG','clean-03.JPG','clean-04.JPG','dirty-01.JPG','dirty-02.JPG','dirty-03.JPG','dirty-04.JPG']
|
14 |
+
interpretation='default'
|
15 |
+
enable_queue=True
|
16 |
+
|
17 |
+
gr.Interface(fn=predict,
|
18 |
+
inputs=gr.inputs.Image(shape=(192, 192)),
|
19 |
+
outputs=gr.outputs.Label(num_top_classes=2),
|
20 |
+
title=title,
|
21 |
+
examples=examples).launch(inline=False)
|
clean-01.JPG
ADDED
Git LFS Details
|
clean-02.JPG
ADDED
Git LFS Details
|
clean-03.JPG
ADDED
Git LFS Details
|
clean-04.JPG
ADDED
Git LFS Details
|
dirty-01.JPG
ADDED
Git LFS Details
|
dirty-02.JPG
ADDED
Git LFS Details
|
dirty-03.JPG
ADDED
Git LFS Details
|
dirty-04.JPG
ADDED
Git LFS Details
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
fastai
|
2 |
+
gradio
|
seiba-edisa-apple-bins.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:faec908e4adcf86afedc390bea53ae8f5c7f4505f50f20725c68a8f29b9354b7
|
3 |
+
size 46962926
|