Spaces:
Runtime error
Runtime error
Add application file
Browse files
app.py
CHANGED
|
@@ -59,10 +59,10 @@ def classify_image(img):
|
|
| 59 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
| 60 |
|
| 61 |
image = gr.inputs.Image(shape=(256, 256))
|
| 62 |
-
label = gr.outputs.Label()
|
| 63 |
examples = ['images/airplane_002.jpg','images/airplane_003.jpg','images/airport_020.jpg','images/airport_075.jpg','images/bridge_679.jpg','images/cloud_227.jpg','images/freeway_159.jpg','images/forest_235.jpg']
|
| 64 |
|
| 65 |
-
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
| 66 |
|
| 67 |
if __name__ == "__main__":
|
| 68 |
intf.launch(share=True,inline=False)
|
|
|
|
| 59 |
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
| 60 |
|
| 61 |
image = gr.inputs.Image(shape=(256, 256))
|
| 62 |
+
label = gr.outputs.Label(num_top_classes=45)
|
| 63 |
examples = ['images/airplane_002.jpg','images/airplane_003.jpg','images/airport_020.jpg','images/airport_075.jpg','images/bridge_679.jpg','images/cloud_227.jpg','images/freeway_159.jpg','images/forest_235.jpg']
|
| 64 |
|
| 65 |
+
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, capture_session=True, interpretation="default", examples=examples)
|
| 66 |
|
| 67 |
if __name__ == "__main__":
|
| 68 |
intf.launch(share=True,inline=False)
|