ghost233lism commited on
Commit
d21010d
Β·
verified Β·
1 Parent(s): 366b762

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +40 -38
app.py CHANGED
@@ -296,40 +296,41 @@ 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(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",
320
  label="Colormap"
321
  )
322
 
 
323
  image_submit_btn = gr.Button(
324
  "🎯 Generate Image Depth Map",
325
  variant="primary",
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"],
@@ -348,38 +349,39 @@ with gr.Blocks(title="Depth Anything AC - Depth Estimation Demo", theme=gr.theme
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",
370
  label="Colormap"
371
  )
372
 
 
373
  video_submit_btn = gr.Button(
374
  "🎯 Generate Video Depth Map",
375
  variant="primary",
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=[
385
  ["toyset/fog.mp4", "Spectral"],
 
296
  with gr.Tabs():
297
  # Image processing tab
298
  with gr.TabItem("πŸ“· Image Depth Estimation"):
299
+ # Main image display row with strict alignment
300
+ with gr.Row():
301
+ input_image = gr.Image(
302
+ label="Upload Image",
303
+ type="pil",
304
+ height=400,
305
+ container=True,
306
+ scale=1
307
+ )
308
+
309
+ output_image = gr.Image(
310
+ label="Depth Map Result",
311
+ type="pil",
312
+ height=400,
313
+ container=True,
314
+ scale=1
315
+ )
316
 
317
+ # Controls section in a separate row
318
  with gr.Row():
319
+ with gr.Column(scale=2):
320
  image_colormap_choice = gr.Dropdown(
321
  choices=["Spectral", "Inferno", "Gray"],
322
  value="Spectral",
323
  label="Colormap"
324
  )
325
 
326
+ with gr.Column(scale=2):
327
  image_submit_btn = gr.Button(
328
  "🎯 Generate Image Depth Map",
329
  variant="primary",
330
  size="lg"
331
  )
 
 
 
 
332
 
333
+ # Examples section
334
  gr.Examples(
335
  examples=[
336
  ["toyset/1.png", "Spectral"],
 
349
 
350
  # Video processing tab
351
  with gr.TabItem("🎬 Video Depth Estimation"):
352
+ # Main video display row with strict alignment
353
+ with gr.Row():
354
+ input_video = gr.Video(
355
+ label="Upload Video",
356
+ height=400,
357
+ container=True,
358
+ scale=1
359
+ )
360
+
361
+ output_video = gr.Video(
362
+ label="Depth Map Video Result",
363
+ height=400,
364
+ container=True,
365
+ scale=1
366
+ )
367
 
368
+ # Controls section in a separate row
369
  with gr.Row():
370
+ with gr.Column(scale=2):
371
  video_colormap_choice = gr.Dropdown(
372
  choices=["Spectral", "Inferno", "Gray"],
373
  value="Spectral",
374
  label="Colormap"
375
  )
376
 
377
+ with gr.Column(scale=2):
378
  video_submit_btn = gr.Button(
379
  "🎯 Generate Video Depth Map",
380
  variant="primary",
381
  size="lg"
382
  )
 
 
 
 
383
 
384
+ # Examples section
385
  gr.Examples(
386
  examples=[
387
  ["toyset/fog.mp4", "Spectral"],