Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -210,8 +210,6 @@ def navigate(input_numpy_image: np.ndarray, task: str) -> Tuple[str, Optional[Im
|
|
| 210 |
|
| 211 |
prompt = get_navigation_prompt(task, input_pil_image)
|
| 212 |
|
| 213 |
-
print("Prompt:")
|
| 214 |
-
print(prompt)
|
| 215 |
|
| 216 |
if model is None:
|
| 217 |
raise ValueError("Model not loaded")
|
|
@@ -252,9 +250,10 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 252 |
gr.Markdown(f"<h1 style='text-align: center;'>{title}</h1>")
|
| 253 |
# gr.Markdown(description)
|
| 254 |
|
|
|
|
|
|
|
| 255 |
with gr.Row():
|
| 256 |
with gr.Column():
|
| 257 |
-
input_image_component = gr.Image(label="Input UI Image", height=400)
|
| 258 |
task_component = gr.Textbox(
|
| 259 |
label="task",
|
| 260 |
placeholder="e.g., Search for the name of the current UK Prime Minister.",
|
|
@@ -266,12 +265,12 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 266 |
localization_image_component = gr.Image(label="Action Localization", height=400)
|
| 267 |
output_coords_component = gr.Textbox(label="Agent Output", lines=10)
|
| 268 |
|
| 269 |
-
submit_button.click(navigate, [input_image_component, task_component], [output_coords_component,
|
| 270 |
|
| 271 |
gr.Examples(
|
| 272 |
examples=[[example_1_image, example_1_task], [example_2_image, example_2_task]],
|
| 273 |
inputs=[input_image_component, task_component],
|
| 274 |
-
outputs=[output_coords_component,
|
| 275 |
fn=navigate,
|
| 276 |
cache_examples=True,
|
| 277 |
)
|
|
|
|
| 210 |
|
| 211 |
prompt = get_navigation_prompt(task, input_pil_image)
|
| 212 |
|
|
|
|
|
|
|
| 213 |
|
| 214 |
if model is None:
|
| 215 |
raise ValueError("Model not loaded")
|
|
|
|
| 250 |
gr.Markdown(f"<h1 style='text-align: center;'>{title}</h1>")
|
| 251 |
# gr.Markdown(description)
|
| 252 |
|
| 253 |
+
with gr.Row():
|
| 254 |
+
input_image_component = gr.Image(label="UI Image", height=500)
|
| 255 |
with gr.Row():
|
| 256 |
with gr.Column():
|
|
|
|
| 257 |
task_component = gr.Textbox(
|
| 258 |
label="task",
|
| 259 |
placeholder="e.g., Search for the name of the current UK Prime Minister.",
|
|
|
|
| 265 |
localization_image_component = gr.Image(label="Action Localization", height=400)
|
| 266 |
output_coords_component = gr.Textbox(label="Agent Output", lines=10)
|
| 267 |
|
| 268 |
+
submit_button.click(navigate, [input_image_component, task_component], [output_coords_component, input_image_component])
|
| 269 |
|
| 270 |
gr.Examples(
|
| 271 |
examples=[[example_1_image, example_1_task], [example_2_image, example_2_task]],
|
| 272 |
inputs=[input_image_component, task_component],
|
| 273 |
+
outputs=[output_coords_component, input_image_component],
|
| 274 |
fn=navigate,
|
| 275 |
cache_examples=True,
|
| 276 |
)
|