Insta360-Research commited on
Commit
fd446b6
·
verified ·
1 Parent(s): 4018482

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -12
app.py CHANGED
@@ -128,22 +128,29 @@ example_paths = [
128
  ]
129
 
130
  with gr.Blocks() as demo:
131
- gr.Markdown("# DAP Depth Prediction Demo\nChoose an example or upload your own image.")
132
 
133
- inp = gr.Image(type="numpy", label="Input Image")
134
- out_color = gr.Image(type="numpy", label="Depth (Color)")
135
- out_gray = gr.Image(type="numpy", label="Depth (Gray)")
136
- out_npy = gr.File(label="Depth (.npy)")
137
 
138
- btn = gr.Button("Run")
 
 
 
 
 
139
 
140
- btn.click(fn=predict, inputs=inp, outputs=[out_color, out_gray, out_npy])
141
 
142
- gr.Examples(
143
- examples=example_paths,
144
- inputs=inp,
145
- label="Examples (click to load)",
146
- )
 
 
147
 
148
  demo.launch(
149
  server_name="0.0.0.0",
 
128
  ]
129
 
130
  with gr.Blocks() as demo:
131
+ gr.Markdown("# DAP Depth Prediction Demo")
132
 
133
+ with gr.Row():
134
+ # ================= Left =================
135
+ with gr.Column(scale=1):
136
+ inp = gr.Image(type="numpy", label="Input Image", height=360)
137
 
138
+ gr.Markdown("### Examples (click to load)")
139
+ gr.Examples(
140
+ examples=example_paths,
141
+ inputs=inp,
142
+ label=None,
143
+ )
144
 
145
+ btn = gr.Button("Run", variant="primary")
146
 
147
+ # ================= Right =================
148
+ with gr.Column(scale=2):
149
+ out_color = gr.Image(type="numpy", label="Depth (Color)", height=260)
150
+ out_gray = gr.Image(type="numpy", label="Depth (Gray)", height=260)
151
+ out_npy = gr.File(label="Depth (.npy)")
152
+
153
+ btn.click(fn=predict, inputs=inp, outputs=[out_color, out_gray, out_npy])
154
 
155
  demo.launch(
156
  server_name="0.0.0.0",