Spaces:
Sleeping
Sleeping
added components method
Browse files
app.py
CHANGED
|
@@ -12,11 +12,13 @@ def classify_image(img):
|
|
| 12 |
pred,pred_idx,probs = learn.predict(img)
|
| 13 |
return dict(zip(categories, map(float,probs)))
|
| 14 |
|
| 15 |
-
image = gr.Image(shape=(224,224)
|
| 16 |
-
label = gr.Label()
|
| 17 |
examples = ['cat.jpg', 'dog.jpg', 'dunno.jpg']
|
|
|
|
|
|
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
-
iface = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
| 22 |
iface.launch(inline=False)
|
|
|
|
| 12 |
pred,pred_idx,probs = learn.predict(img)
|
| 13 |
return dict(zip(categories, map(float,probs)))
|
| 14 |
|
| 15 |
+
image = gr.components.Image(shape=(224,224))
|
| 16 |
+
label = gr.components.Label(num_top_classes=3)
|
| 17 |
examples = ['cat.jpg', 'dog.jpg', 'dunno.jpg']
|
| 18 |
+
interpretation='default'
|
| 19 |
+
enable_queue=True
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
+
iface = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples,interpretation=interpretation, enable_queue=enable_queue)
|
| 24 |
iface.launch(inline=False)
|