Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
|
@@ -296,14 +296,24 @@ with gr.Blocks(title="Depth Anything AC - Depth Estimation Demo", theme=gr.theme
|
|
| 296 |
with gr.Tabs():
|
| 297 |
# Image processing tab
|
| 298 |
with gr.TabItem("π· Image Depth Estimation"):
|
| 299 |
-
with gr.Row():
|
| 300 |
-
with gr.Column():
|
| 301 |
input_image = gr.Image(
|
| 302 |
label="Upload Image",
|
| 303 |
type="pil",
|
| 304 |
height=400
|
| 305 |
)
|
| 306 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 307 |
image_colormap_choice = gr.Dropdown(
|
| 308 |
choices=["Spectral", "Inferno", "Gray"],
|
| 309 |
value="Spectral",
|
|
@@ -316,17 +326,17 @@ with gr.Blocks(title="Depth Anything AC - Depth Estimation Demo", theme=gr.theme
|
|
| 316 |
size="lg"
|
| 317 |
)
|
| 318 |
|
| 319 |
-
with gr.Column():
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
type="pil",
|
| 323 |
-
height=400
|
| 324 |
-
)
|
| 325 |
|
| 326 |
gr.Examples(
|
| 327 |
examples=[
|
| 328 |
["toyset/1.png", "Spectral"],
|
| 329 |
["toyset/2.png", "Spectral"],
|
|
|
|
|
|
|
|
|
|
| 330 |
["toyset/good.png", "Spectral"],
|
| 331 |
] if os.path.exists("toyset") else [],
|
| 332 |
inputs=[input_image, image_colormap_choice],
|
|
@@ -338,13 +348,22 @@ with gr.Blocks(title="Depth Anything AC - Depth Estimation Demo", theme=gr.theme
|
|
| 338 |
|
| 339 |
# Video processing tab
|
| 340 |
with gr.TabItem("π¬ Video Depth Estimation"):
|
| 341 |
-
with gr.Row():
|
| 342 |
-
with gr.Column():
|
| 343 |
input_video = gr.Video(
|
| 344 |
label="Upload Video",
|
| 345 |
height=400
|
| 346 |
)
|
| 347 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 348 |
video_colormap_choice = gr.Dropdown(
|
| 349 |
choices=["Spectral", "Inferno", "Gray"],
|
| 350 |
value="Spectral",
|
|
@@ -357,11 +376,9 @@ with gr.Blocks(title="Depth Anything AC - Depth Estimation Demo", theme=gr.theme
|
|
| 357 |
size="lg"
|
| 358 |
)
|
| 359 |
|
| 360 |
-
with gr.Column():
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
height=400
|
| 364 |
-
)
|
| 365 |
|
| 366 |
gr.Examples(
|
| 367 |
examples=[
|
|
|
|
| 296 |
with gr.Tabs():
|
| 297 |
# Image processing tab
|
| 298 |
with gr.TabItem("π· Image Depth Estimation"):
|
| 299 |
+
with gr.Row(equal_height=True):
|
| 300 |
+
with gr.Column(scale=1):
|
| 301 |
input_image = gr.Image(
|
| 302 |
label="Upload Image",
|
| 303 |
type="pil",
|
| 304 |
height=400
|
| 305 |
)
|
| 306 |
|
| 307 |
+
with gr.Column(scale=1):
|
| 308 |
+
output_image = gr.Image(
|
| 309 |
+
label="Depth Map Result",
|
| 310 |
+
type="pil",
|
| 311 |
+
height=400
|
| 312 |
+
)
|
| 313 |
+
|
| 314 |
+
# Controls section below the aligned images
|
| 315 |
+
with gr.Row():
|
| 316 |
+
with gr.Column(scale=1):
|
| 317 |
image_colormap_choice = gr.Dropdown(
|
| 318 |
choices=["Spectral", "Inferno", "Gray"],
|
| 319 |
value="Spectral",
|
|
|
|
| 326 |
size="lg"
|
| 327 |
)
|
| 328 |
|
| 329 |
+
with gr.Column(scale=1):
|
| 330 |
+
# Empty column for balance
|
| 331 |
+
gr.Markdown("")
|
|
|
|
|
|
|
|
|
|
| 332 |
|
| 333 |
gr.Examples(
|
| 334 |
examples=[
|
| 335 |
["toyset/1.png", "Spectral"],
|
| 336 |
["toyset/2.png", "Spectral"],
|
| 337 |
+
["toyset/3.png", "Spectral"],
|
| 338 |
+
["toyset/4.png", "Spectral"],
|
| 339 |
+
["toyset/5.png", "Spectral"],
|
| 340 |
["toyset/good.png", "Spectral"],
|
| 341 |
] if os.path.exists("toyset") else [],
|
| 342 |
inputs=[input_image, image_colormap_choice],
|
|
|
|
| 348 |
|
| 349 |
# Video processing tab
|
| 350 |
with gr.TabItem("π¬ Video Depth Estimation"):
|
| 351 |
+
with gr.Row(equal_height=True):
|
| 352 |
+
with gr.Column(scale=1):
|
| 353 |
input_video = gr.Video(
|
| 354 |
label="Upload Video",
|
| 355 |
height=400
|
| 356 |
)
|
| 357 |
|
| 358 |
+
with gr.Column(scale=1):
|
| 359 |
+
output_video = gr.Video(
|
| 360 |
+
label="Depth Map Video Result",
|
| 361 |
+
height=400
|
| 362 |
+
)
|
| 363 |
+
|
| 364 |
+
# Controls section below the aligned videos
|
| 365 |
+
with gr.Row():
|
| 366 |
+
with gr.Column(scale=1):
|
| 367 |
video_colormap_choice = gr.Dropdown(
|
| 368 |
choices=["Spectral", "Inferno", "Gray"],
|
| 369 |
value="Spectral",
|
|
|
|
| 376 |
size="lg"
|
| 377 |
)
|
| 378 |
|
| 379 |
+
with gr.Column(scale=1):
|
| 380 |
+
# Empty column for balance
|
| 381 |
+
gr.Markdown("")
|
|
|
|
|
|
|
| 382 |
|
| 383 |
gr.Examples(
|
| 384 |
examples=[
|