Spaces:
Runtime error
Runtime error
Vision-CAIR
commited on
Commit
β’
2ec1975
1
Parent(s):
08f5f1e
Update app.py
Browse files
app.py
CHANGED
@@ -419,8 +419,6 @@ def gradio_ask(user_message, chatbot, chat_state, gr_img, img_list, upload_flag,
|
|
419 |
text_box_show = 'Input should not be empty!'
|
420 |
else:
|
421 |
text_box_show = ''
|
422 |
-
if not isinstance(path_list, list):
|
423 |
-
path_list = []
|
424 |
if isinstance(gr_img, dict):
|
425 |
gr_img, mask = gr_img['image'], gr_img['mask']
|
426 |
else:
|
@@ -492,8 +490,6 @@ def gradio_stream_answer(chatbot, chat_state, img_list, temperature):
|
|
492 |
def gradio_visualize(chatbot, gr_img, path_list):
|
493 |
if isinstance(gr_img, dict):
|
494 |
gr_img, mask = gr_img['image'], gr_img['mask']
|
495 |
-
if not isinstance(path_list, list):
|
496 |
-
path_list = []
|
497 |
unescaped = reverse_escape(chatbot[-1][1])
|
498 |
visual_img, generation_color = visualize_all_bbox_together(gr_img, unescaped)
|
499 |
if visual_img is not None:
|
@@ -589,7 +585,7 @@ with gr.Blocks() as demo:
|
|
589 |
|
590 |
upload_flag = gr.State(value=0)
|
591 |
replace_flag = gr.State(value=0)
|
592 |
-
path_list = gr.State(value=
|
593 |
image.upload(image_upload_trigger, [upload_flag, replace_flag, img_list], [upload_flag, replace_flag])
|
594 |
|
595 |
with gr.Row():
|
|
|
419 |
text_box_show = 'Input should not be empty!'
|
420 |
else:
|
421 |
text_box_show = ''
|
|
|
|
|
422 |
if isinstance(gr_img, dict):
|
423 |
gr_img, mask = gr_img['image'], gr_img['mask']
|
424 |
else:
|
|
|
490 |
def gradio_visualize(chatbot, gr_img, path_list):
|
491 |
if isinstance(gr_img, dict):
|
492 |
gr_img, mask = gr_img['image'], gr_img['mask']
|
|
|
|
|
493 |
unescaped = reverse_escape(chatbot[-1][1])
|
494 |
visual_img, generation_color = visualize_all_bbox_together(gr_img, unescaped)
|
495 |
if visual_img is not None:
|
|
|
585 |
|
586 |
upload_flag = gr.State(value=0)
|
587 |
replace_flag = gr.State(value=0)
|
588 |
+
path_list = gr.State(value=[])
|
589 |
image.upload(image_upload_trigger, [upload_flag, replace_flag, img_list], [upload_flag, replace_flag])
|
590 |
|
591 |
with gr.Row():
|