Spaces:
Runtime error
Runtime error
Commit
·
98278a1
1
Parent(s):
13f8932
added all kategoreis
Browse files
app.py
CHANGED
@@ -5,7 +5,24 @@ import gradio as gr
|
|
5 |
def classify_image(img):
|
6 |
from fastai.vision.all import load_learner
|
7 |
learn = load_learner('lego-bricks-model.pkl')
|
8 |
-
categories = (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
pred,idx,probs = learn.predict(img)
|
10 |
return dict(zip(categories, map(float,probs)))
|
11 |
|
|
|
5 |
def classify_image(img):
|
6 |
from fastai.vision.all import load_learner
|
7 |
learn = load_learner('lego-bricks-model.pkl')
|
8 |
+
categories = (
|
9 |
+
'11214 Bush 3M friction with Cross axle',
|
10 |
+
'18651 Cross Axle 2M with Snap friction',
|
11 |
+
'2357 Brick corner 1x2x2',
|
12 |
+
'3003 Brick 2x2',
|
13 |
+
'3004 Brick 1x2',
|
14 |
+
'3005 Brick 1x1',
|
15 |
+
'3022 Plate 2x2',
|
16 |
+
'3023 Plate 1x2',
|
17 |
+
'3024 Plate 1x1',
|
18 |
+
'3040 Roof Tile 1x2x45deg',
|
19 |
+
'3069 Flat Tile 1x2',
|
20 |
+
'32123 half Bush'
|
21 |
+
'3673 Peg 2M',
|
22 |
+
'3713 Bush for Cross Axle',
|
23 |
+
'3794 Plate 1X2 with 1 Knob',
|
24 |
+
'6632 Technic Lever 3M',
|
25 |
+
)
|
26 |
pred,idx,probs = learn.predict(img)
|
27 |
return dict(zip(categories, map(float,probs)))
|
28 |
|