Spaces:
Sleeping
Sleeping
NasrinRipa commited on
Commit ·
3055888
1
Parent(s): 2a425b7
nut_recognizer final version v14
Browse files- Pistachio.jpg +0 -0
- almonds.jpg +0 -0
- app.py +24 -20
- chestnuts.jpg +0 -0
- ginkgo nuts.jpg +0 -0
- macadamia-nut.jpg +0 -0
- macadamia.jpg +0 -0
- nut-recognizer-v11 .pkl → nut-recognizer-v14.pkl +2 -2
- nut-recognizer-v4 .pkl +0 -3
- peanuts.jpg +0 -0
- pili nuts.jpg +0 -0
- pistachios.jpeg +0 -0
- walnuts.jpg +0 -0
Pistachio.jpg
DELETED
|
Binary file (86.6 kB)
|
|
|
almonds.jpg
ADDED
|
app.py
CHANGED
|
@@ -6,24 +6,24 @@ from pathlib import Path
|
|
| 6 |
#temp = pathlib.PosixPath
|
| 7 |
#pathlib.PosixPath = pathlib.WindowsPath
|
| 8 |
|
| 9 |
-
nut_labels =
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
|
| 26 |
-
model = load_learner('nut-recognizer-
|
| 27 |
|
| 28 |
|
| 29 |
def recognize_image(image):
|
|
@@ -33,10 +33,14 @@ def recognize_image(image):
|
|
| 33 |
image = gr.inputs.Image(shape=(192,192))
|
| 34 |
label = gr.outputs.Label(num_top_classes=5)
|
| 35 |
examples = [
|
| 36 |
-
'
|
| 37 |
'cashew.jpg',
|
| 38 |
-
'macadamia
|
| 39 |
-
'peanuts.jpg'
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
]
|
| 41 |
|
| 42 |
iface = gr.Interface(fn=recognize_image, inputs=image, outputs=label, examples=examples)
|
|
|
|
| 6 |
#temp = pathlib.PosixPath
|
| 7 |
#pathlib.PosixPath = pathlib.WindowsPath
|
| 8 |
|
| 9 |
+
nut_labels = [
|
| 10 |
+
'raw Almonds',
|
| 11 |
+
'raw Brazil nut',
|
| 12 |
+
'raw Cashew nut',
|
| 13 |
+
'raw Chestnut',
|
| 14 |
+
'raw Ginkgo nut',
|
| 15 |
+
'raw Hazelnuts',
|
| 16 |
+
'raw Hickory nut',
|
| 17 |
+
'raw Maccademia nut',
|
| 18 |
+
'raw Peanut',
|
| 19 |
+
'raw Pecans',
|
| 20 |
+
'raw Pili nut',
|
| 21 |
+
'raw Pine nut',
|
| 22 |
+
'raw Pistachios nut',
|
| 23 |
+
'raw Walnuts'
|
| 24 |
+
]
|
| 25 |
|
| 26 |
+
model = load_learner('nut-recognizer-v14 .pkl')
|
| 27 |
|
| 28 |
|
| 29 |
def recognize_image(image):
|
|
|
|
| 33 |
image = gr.inputs.Image(shape=(192,192))
|
| 34 |
label = gr.outputs.Label(num_top_classes=5)
|
| 35 |
examples = [
|
| 36 |
+
'pistachios.jpeg',
|
| 37 |
'cashew.jpg',
|
| 38 |
+
'macadamia.jpg',
|
| 39 |
+
'peanuts.jpg',
|
| 40 |
+
'walnuts',
|
| 41 |
+
'chestnuts',
|
| 42 |
+
'pili nuts.jpg',
|
| 43 |
+
'ginkgo nuts'
|
| 44 |
]
|
| 45 |
|
| 46 |
iface = gr.Interface(fn=recognize_image, inputs=image, outputs=label, examples=examples)
|
chestnuts.jpg
ADDED
|
ginkgo nuts.jpg
ADDED
|
macadamia-nut.jpg
DELETED
|
Binary file (122 kB)
|
|
|
macadamia.jpg
ADDED
|
nut-recognizer-v11 .pkl → nut-recognizer-v14.pkl
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b758dec0e5d246dad099b08368874336308b4d19e6023c11746c590e0d0baa03
|
| 3 |
+
size 87540304
|
nut-recognizer-v4 .pkl
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:5b7faff519d6c3d08d4d59c5a8fc0acac1655a61f656b78e40cb8e6779a40b61
|
| 3 |
-
size 87521093
|
|
|
|
|
|
|
|
|
|
|
|
peanuts.jpg
CHANGED
|
|
pili nuts.jpg
ADDED
|
pistachios.jpeg
ADDED
|
walnuts.jpg
ADDED
|