Spaces:
Running
on
Zero
Running
on
Zero
Return coordinates along with the regular text output
Browse files
app.py
CHANGED
@@ -84,7 +84,8 @@ def process(
|
|
84 |
image = Image.open(io.BytesIO(base64.b64decode(dino_labled_img)))
|
85 |
print('finish processing')
|
86 |
parsed_content_list = '\n'.join(parsed_content_list)
|
87 |
-
|
|
|
88 |
|
89 |
|
90 |
|
@@ -105,6 +106,7 @@ with gr.Blocks() as demo:
|
|
105 |
with gr.Column():
|
106 |
image_output_component = gr.Image(type='pil', label='Image Output')
|
107 |
text_output_component = gr.Textbox(label='Parsed screen elements', placeholder='Text Output')
|
|
|
108 |
|
109 |
submit_button_component.click(
|
110 |
fn=process,
|
@@ -113,7 +115,7 @@ with gr.Blocks() as demo:
|
|
113 |
box_threshold_component,
|
114 |
iou_threshold_component
|
115 |
],
|
116 |
-
outputs=[image_output_component, text_output_component]
|
117 |
)
|
118 |
|
119 |
# demo.launch(debug=False, show_error=True, share=True)
|
|
|
84 |
image = Image.open(io.BytesIO(base64.b64decode(dino_labled_img)))
|
85 |
print('finish processing')
|
86 |
parsed_content_list = '\n'.join(parsed_content_list)
|
87 |
+
label_coordinates_str = label_coordinates
|
88 |
+
return image, str(parsed_content_list), str(label_coordinates)
|
89 |
|
90 |
|
91 |
|
|
|
106 |
with gr.Column():
|
107 |
image_output_component = gr.Image(type='pil', label='Image Output')
|
108 |
text_output_component = gr.Textbox(label='Parsed screen elements', placeholder='Text Output')
|
109 |
+
coordinates_output_component = gr.Textbox(label='Coordinates', placeholder='Coordinates Output')
|
110 |
|
111 |
submit_button_component.click(
|
112 |
fn=process,
|
|
|
115 |
box_threshold_component,
|
116 |
iou_threshold_component
|
117 |
],
|
118 |
+
outputs=[image_output_component, text_output_component, coordinates_output_component]
|
119 |
)
|
120 |
|
121 |
# demo.launch(debug=False, show_error=True, share=True)
|