Spaces:
Running
Running
akashraj98283
commited on
Commit
•
8d63354
1
Parent(s):
72e1e0f
Update app.py
Browse files
app.py
CHANGED
@@ -5,17 +5,17 @@ import gradio as gr
|
|
5 |
# Load the Hugging Face depth estimation pipelines
|
6 |
pipe_base = pipeline(task="depth-estimation", model="LiheYoung/depth-anything-base-hf")
|
7 |
pipe_small = pipeline(task="depth-estimation", model="LiheYoung/depth-anything-small-hf")
|
8 |
-
|
9 |
pipe_beit = pipeline(task="depth-estimation", model="Intel/dpt-beit-base-384")
|
10 |
|
11 |
def estimate_depths(image):
|
12 |
# Perform depth estimation with each pipeline
|
13 |
depth_base = pipe_base(image)["depth"]
|
14 |
depth_small = pipe_small(image)["depth"]
|
15 |
-
|
16 |
depth_beit = pipe_beit(image)["depth"]
|
17 |
|
18 |
-
return depth_base, depth_small,
|
19 |
|
20 |
# Create a Gradio interface using Blocks
|
21 |
with gr.Blocks() as iface:
|
@@ -29,10 +29,10 @@ with gr.Blocks() as iface:
|
|
29 |
output_base = gr.Image(type="pil", label="LiheYoung/depth-anything-base-hf", interactive=False, height=400, width=400)
|
30 |
output_small = gr.Image(type="pil", label="LiheYoung/depth-anything-small-hf", interactive=False, height=400, width=400)
|
31 |
with gr.Column():
|
32 |
-
|
33 |
output_beit = gr.Image(type="pil", label="Intel/dpt-beit-base-384", interactive=False, height=400, width=400)
|
34 |
|
35 |
-
input_image.change(fn=estimate_depths, inputs=input_image, outputs=[output_base, output_small,
|
36 |
|
37 |
# Launch the Gradio app
|
38 |
iface.launch()
|
|
|
5 |
# Load the Hugging Face depth estimation pipelines
|
6 |
pipe_base = pipeline(task="depth-estimation", model="LiheYoung/depth-anything-base-hf")
|
7 |
pipe_small = pipeline(task="depth-estimation", model="LiheYoung/depth-anything-small-hf")
|
8 |
+
pipe_large = pipeline(task="depth-estimation", model="LiheYoung/depth-anything-large-hf")
|
9 |
pipe_beit = pipeline(task="depth-estimation", model="Intel/dpt-beit-base-384")
|
10 |
|
11 |
def estimate_depths(image):
|
12 |
# Perform depth estimation with each pipeline
|
13 |
depth_base = pipe_base(image)["depth"]
|
14 |
depth_small = pipe_small(image)["depth"]
|
15 |
+
depth_large = pipe_large(image)["depth"]
|
16 |
depth_beit = pipe_beit(image)["depth"]
|
17 |
|
18 |
+
return depth_base, depth_small, depth_large, depth_beit
|
19 |
|
20 |
# Create a Gradio interface using Blocks
|
21 |
with gr.Blocks() as iface:
|
|
|
29 |
output_base = gr.Image(type="pil", label="LiheYoung/depth-anything-base-hf", interactive=False, height=400, width=400)
|
30 |
output_small = gr.Image(type="pil", label="LiheYoung/depth-anything-small-hf", interactive=False, height=400, width=400)
|
31 |
with gr.Column():
|
32 |
+
output_large = gr.Image(type="pil", label="LiheYoung/depth-anything-large-hf", interactive=False, height=400, width=400)
|
33 |
output_beit = gr.Image(type="pil", label="Intel/dpt-beit-base-384", interactive=False, height=400, width=400)
|
34 |
|
35 |
+
input_image.change(fn=estimate_depths, inputs=input_image, outputs=[output_base, output_small, output_large, output_beit])
|
36 |
|
37 |
# Launch the Gradio app
|
38 |
iface.launch()
|