Spaces:
Runtime error
Runtime error
update
Browse files
app.py
CHANGED
|
@@ -173,7 +173,7 @@ def gradio_answer(image, chatbot, chat_state, emb_list, num_beams, temperature,
|
|
| 173 |
entity_state['match_state'] = match_state # item_id -> local_id
|
| 174 |
new_grounded_image = grounding_dino.draw(image, entity_state)
|
| 175 |
show_legend = bool(match_state)
|
| 176 |
-
print('gradio_answer ==> current state: ', entity_state)
|
| 177 |
|
| 178 |
# if args.ground_all:
|
| 179 |
# ground_img, local_results = grounding_dino.prompt2mask(image,
|
|
@@ -203,7 +203,7 @@ def grounding_fn(image, chatbot, entity_state):
|
|
| 203 |
'full': ground_img,
|
| 204 |
'local': local_results
|
| 205 |
}
|
| 206 |
-
print('grounding_fn ==> current state: ', entity_state)
|
| 207 |
return chatbot, gr.update(value=ground_img, interactive=False), entity_state
|
| 208 |
return chatbot, gr.update(value=None, interactive=False), entity_state
|
| 209 |
|
|
@@ -215,7 +215,7 @@ def select_fn(image, ground_img, entity_state, evt: gr.SelectData):
|
|
| 215 |
|
| 216 |
if label is None:
|
| 217 |
return ground_img
|
| 218 |
-
print('select_fn ==> current state: ', entity_state)
|
| 219 |
torch.cuda.synchronize()
|
| 220 |
if 'grounding' not in entity_state:
|
| 221 |
ground_img, local_results = grounding_dino.prompt2mask2(image,
|
|
|
|
| 173 |
entity_state['match_state'] = match_state # item_id -> local_id
|
| 174 |
new_grounded_image = grounding_dino.draw(image, entity_state)
|
| 175 |
show_legend = bool(match_state)
|
| 176 |
+
# print('gradio_answer ==> current state: ', entity_state)
|
| 177 |
|
| 178 |
# if args.ground_all:
|
| 179 |
# ground_img, local_results = grounding_dino.prompt2mask(image,
|
|
|
|
| 203 |
'full': ground_img,
|
| 204 |
'local': local_results
|
| 205 |
}
|
| 206 |
+
# print('grounding_fn ==> current state: ', entity_state)
|
| 207 |
return chatbot, gr.update(value=ground_img, interactive=False), entity_state
|
| 208 |
return chatbot, gr.update(value=None, interactive=False), entity_state
|
| 209 |
|
|
|
|
| 215 |
|
| 216 |
if label is None:
|
| 217 |
return ground_img
|
| 218 |
+
# print('select_fn ==> current state: ', entity_state)
|
| 219 |
torch.cuda.synchronize()
|
| 220 |
if 'grounding' not in entity_state:
|
| 221 |
ground_img, local_results = grounding_dino.prompt2mask2(image,
|