bmay commited on
Commit
6273591
·
verified ·
1 Parent(s): 2eca07c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -55,9 +55,10 @@ def run_theia(image):
55
  gt_sam = (255.0 * gt_results[0]).astype(np.uint8)[:, 2 * width // 4 : 3 * width // 4, :]
56
  gt_depth = (255.0 * gt_results[0]).astype(np.uint8)[:, 3 * width // 4 :, :]
57
 
58
- theia_output = [(theia_decode_dino, "DINOv2"), (theia_decode_sam, "SAM"), (theia_decode_depth, "Depth-Anything")]
59
- gt_output = [(gt_dino, "DINOv2"), (gt_sam, "SAM"), (gt_depth, "Depth-Anything")]
60
- return theia_output, gt_output
 
61
 
62
  with gr.Blocks() as demo:
63
  gr.HTML(load_description("gradio_title.md"))
@@ -70,12 +71,15 @@ with gr.Blocks() as demo:
70
  submit_button = gr.Button("Submit")
71
 
72
  with gr.Column():
73
- gr.Markdown("### Theia Results")
74
- theia_output = gr.Gallery(label=None, type="numpy")
75
 
76
- gr.Markdown("### Ground Truth")
77
- gt_output = gr.Gallery(label=None, type="numpy")
78
 
79
- submit_button.click(run_theia, inputs=input_image, outputs=[theia_output, gt_output])
 
 
 
80
 
81
  demo.launch()
 
55
  gt_sam = (255.0 * gt_results[0]).astype(np.uint8)[:, 2 * width // 4 : 3 * width // 4, :]
56
  gt_depth = (255.0 * gt_results[0]).astype(np.uint8)[:, 3 * width // 4 :, :]
57
 
58
+ dinov2_output = [(theia_decode_dino, "Theia"), (gt_dino, "Ground Truth")]
59
+ sam_output = [(theia_decode_sam, "Theia"), (gt_sam, "Ground Truth")]
60
+ depth_anything_output = [(theia_decode_depth, "Theia"), (gt_depth, "Ground Truth")]
61
+ return dinov2_output, sam_output, depth_anything_output
62
 
63
  with gr.Blocks() as demo:
64
  gr.HTML(load_description("gradio_title.md"))
 
71
  submit_button = gr.Button("Submit")
72
 
73
  with gr.Column():
74
+ gr.Markdown("### DINOv2")
75
+ dinov2_output = gr.Gallery(label=None, type="numpy")
76
 
77
+ gr.Markdown("### SAM")
78
+ sam_output = gr.Gallery(label=None, type="numpy")
79
 
80
+ gr.Markdown("### Depth-Anything")
81
+ depth_anything_output = gr.Gallery(label=None, type="numpy")
82
+
83
+ submit_button.click(run_theia, inputs=input_image, outputs=[dinov2_output, sam_output, depth_anything_output])
84
 
85
  demo.launch()