Update app.py
Browse files
app.py
CHANGED
|
@@ -485,11 +485,11 @@ def infer_seg(media, query):
|
|
| 485 |
|
| 486 |
if not media:
|
| 487 |
gr.Warning('Please upload an image')
|
| 488 |
-
return None, None, None
|
| 489 |
|
| 490 |
if not query:
|
| 491 |
gr.Warning('Please provide a text prompt.')
|
| 492 |
-
return None, None, None
|
| 493 |
|
| 494 |
image = Image.open(media).convert('RGB')
|
| 495 |
ori_width, ori_height = image.size
|
|
@@ -536,6 +536,7 @@ def infer_seg(media, query):
|
|
| 536 |
answer,
|
| 537 |
gr.update(value=None, visible=False), # hide AnnotatedImage
|
| 538 |
gr.update(value=None, interactive=False, visible=False), # hide DownloadButton
|
|
|
|
| 539 |
)
|
| 540 |
|
| 541 |
if len(quant_ids) % CODEBOOK_DEPTH != 0:
|
|
|
|
| 485 |
|
| 486 |
if not media:
|
| 487 |
gr.Warning('Please upload an image')
|
| 488 |
+
return None, None, None, None
|
| 489 |
|
| 490 |
if not query:
|
| 491 |
gr.Warning('Please provide a text prompt.')
|
| 492 |
+
return None, None, None, None
|
| 493 |
|
| 494 |
image = Image.open(media).convert('RGB')
|
| 495 |
ori_width, ori_height = image.size
|
|
|
|
| 536 |
answer,
|
| 537 |
gr.update(value=None, visible=False), # hide AnnotatedImage
|
| 538 |
gr.update(value=None, interactive=False, visible=False), # hide DownloadButton
|
| 539 |
+
gr.update(value="", visible=True),
|
| 540 |
)
|
| 541 |
|
| 542 |
if len(quant_ids) % CODEBOOK_DEPTH != 0:
|