Update app.py
Browse files
app.py
CHANGED
@@ -366,12 +366,12 @@ def inference(image,text):
|
|
366 |
plt.axis('off')
|
367 |
|
368 |
plt.tight_layout()
|
369 |
-
|
370 |
-
return
|
371 |
|
372 |
title = "Lang-Seg"
|
373 |
description = "Gradio demo for Language-driven Semantic Segmentation. To use it, simply add your image and text or click one of the examples to load them. Read more at the links below."
|
374 |
|
375 |
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2201.03546' target='_blank'>Language-driven Semantic Segmentation</a> | <a href='https://github.com/isl-org/lang-seg' target='_blank'>Github Repo</a></p>"
|
376 |
|
377 |
-
gr.Interface(inference,[gr.inputs.Image(type="pil"),"text"],"
|
|
|
366 |
plt.axis('off')
|
367 |
|
368 |
plt.tight_layout()
|
369 |
+
plt.savefig('out.png', bbox_inches='tight')
|
370 |
+
return 'out.png'
|
371 |
|
372 |
title = "Lang-Seg"
|
373 |
description = "Gradio demo for Language-driven Semantic Segmentation. To use it, simply add your image and text or click one of the examples to load them. Read more at the links below."
|
374 |
|
375 |
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2201.03546' target='_blank'>Language-driven Semantic Segmentation</a> | <a href='https://github.com/isl-org/lang-seg' target='_blank'>Github Repo</a></p>"
|
376 |
|
377 |
+
gr.Interface(inference,[gr.inputs.Image(type="pil"),"text"],gr.outputs.Image(type="file"),title=title,description=description,article=article).launch(enable_queue=True)
|