Spaces:
Sleeping
Sleeping
modify app
Browse files
app.py
CHANGED
@@ -6,17 +6,16 @@ learn = load_learner('hotdogmodel.pkl')
|
|
6 |
categories = ('sausage', 'hotdog', 'pepperoni', 'salami', 'chorizo', 'bratwurst', 'kielbasa')
|
7 |
#categories = ('kielbasa', 'pepperoni', 'chorizo', 'bratwurst', 'hotdog', 'sausage', 'salami')
|
8 |
|
9 |
-
|
10 |
-
#def classify_image(img):
|
11 |
-
# pred,idx,probs = learn.predict(img)
|
12 |
-
#return dict(zip(categories, map(float,probs)))
|
13 |
-
|
14 |
def classify_image(img):
|
15 |
pred,idx,probs = learn.predict(img)
|
16 |
-
return
|
|
|
|
|
|
|
|
|
17 |
|
18 |
image = gr.inputs.Image(shape=(192,192))
|
19 |
-
label = gr.outputs.Label()
|
20 |
|
21 |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label)
|
22 |
intf.launch(inline=False)
|
|
|
6 |
categories = ('sausage', 'hotdog', 'pepperoni', 'salami', 'chorizo', 'bratwurst', 'kielbasa')
|
7 |
#categories = ('kielbasa', 'pepperoni', 'chorizo', 'bratwurst', 'hotdog', 'sausage', 'salami')
|
8 |
|
|
|
|
|
|
|
|
|
|
|
9 |
def classify_image(img):
|
10 |
pred,idx,probs = learn.predict(img)
|
11 |
+
return dict(zip(categories, map(float,probs)))
|
12 |
+
|
13 |
+
#def classify_image(img):
|
14 |
+
# pred,idx,probs = learn.predict(img)
|
15 |
+
# return {categories[i] : float(probs[i]) for i in range(len(categories))}
|
16 |
|
17 |
image = gr.inputs.Image(shape=(192,192))
|
18 |
+
label = gr.outputs.Label(meats=7)
|
19 |
|
20 |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label)
|
21 |
intf.launch(inline=False)
|