Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,11 +9,10 @@ def classify_image(img):
|
|
| 9 |
pred,idx,probs = learn.predict(img)
|
| 10 |
return dict(zip(categories, map(float,probs)))
|
| 11 |
|
| 12 |
-
|
| 13 |
|
| 14 |
-
image = gr.inputs.Image(shape=(192,192))
|
| 15 |
label = gr.outputs.Label()
|
| 16 |
examples = ['headphones.jpg', 'neckband.jpg', 'tws.jpg']
|
| 17 |
|
| 18 |
-
intf = gr.Interface(fn=classify_image, inputs=
|
| 19 |
intf.launch(inline=False)
|
|
|
|
| 9 |
pred,idx,probs = learn.predict(img)
|
| 10 |
return dict(zip(categories, map(float,probs)))
|
| 11 |
|
| 12 |
+
image = gr.inputs.Image(type='pil', label="Uploaded Image", source="webcam", shape=(192,192))
|
| 13 |
|
|
|
|
| 14 |
label = gr.outputs.Label()
|
| 15 |
examples = ['headphones.jpg', 'neckband.jpg', 'tws.jpg']
|
| 16 |
|
| 17 |
+
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
| 18 |
intf.launch(inline=False)
|