Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -46,11 +46,12 @@ def run_theia(image):
|
|
| 46 |
gt=True,
|
| 47 |
device='cuda',
|
| 48 |
)
|
| 49 |
-
|
| 50 |
-
theia_decode_results = (255.0 * theia_decode_results[0]).astype(np.uint8)
|
| 51 |
-
gt_decode_results = (255.0 * gt_decode_results[0]).astype(np.uint8)
|
| 52 |
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
with gr.Blocks() as demo:
|
| 56 |
gr.HTML(load_description("gradio_title.md"))
|
|
@@ -62,8 +63,14 @@ with gr.Blocks() as demo:
|
|
| 62 |
submit_button = gr.Button("Submit")
|
| 63 |
|
| 64 |
with gr.Column():
|
| 65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
-
submit_button.click(run_theia, inputs=input_image, outputs=
|
| 68 |
|
| 69 |
demo.launch()
|
|
|
|
| 46 |
gt=True,
|
| 47 |
device='cuda',
|
| 48 |
)
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
+
_, width, _ = theia_decode_results[0].shape
|
| 51 |
+
theia_decode_results = (255.0 * theia_decode_results[0]).astype(np.uint8)[:, width // 4):, :]
|
| 52 |
+
gt_decode_results = (255.0 * gt_decode_results[0]).astype(np.uint8)[:, width // 4:, :]
|
| 53 |
+
|
| 54 |
+
return [theia_decode_results, gt_decode_results]
|
| 55 |
|
| 56 |
with gr.Blocks() as demo:
|
| 57 |
gr.HTML(load_description("gradio_title.md"))
|
|
|
|
| 63 |
submit_button = gr.Button("Submit")
|
| 64 |
|
| 65 |
with gr.Column():
|
| 66 |
+
with gr.Row():
|
| 67 |
+
gr.Markdown("###Theia Results")
|
| 68 |
+
theia_output = gr.Image(label="DINOv2, SAM, Depth Anything", type="numpy")
|
| 69 |
+
|
| 70 |
+
with gr.Row():
|
| 71 |
+
gr.Markdown("###Ground Truth")
|
| 72 |
+
gt_output = gr.Image(label="DINOv2, SAM, Depth Anything", type="numpy")
|
| 73 |
|
| 74 |
+
submit_button.click(run_theia, inputs=input_image, outputs=[theia_output, gt_output])
|
| 75 |
|
| 76 |
demo.launch()
|