mirror of
https://github.com/huchenlei/Depth-Anything.git
synced 2026-04-29 11:51:12 +00:00
Support video depth visualization
This commit is contained in:
5
app.py
5
app.py
@@ -28,6 +28,7 @@ model = DepthAnything.from_pretrained('LiheYoung/depth_anything_vitl14').to(DEVI
|
||||
|
||||
title = "# Depth Anything"
|
||||
description = """Official demo for **Depth Anything: Unleashing the Power of Large-Scale Unlabeled Data**.
|
||||
|
||||
Please refer to our [paper](https://arxiv.org/abs/2401.10891), [project page](https://depth-anything.github.io), or [github](https://github.com/LiheYoung/Depth-Anything) for more details."""
|
||||
|
||||
transform = Compose([
|
||||
@@ -56,7 +57,7 @@ with gr.Blocks(css=css) as demo:
|
||||
|
||||
with gr.Row():
|
||||
input_image = gr.Image(label="Input Image", type='numpy', elem_id='img-display-input')
|
||||
depth_image_slider = ImageSlider(label="Depth Map with Slider View", elem_id='img-display-output', position=0)
|
||||
depth_image_slider = ImageSlider(label="Depth Map with Slider View", elem_id='img-display-output', position=0.5)
|
||||
raw_file = gr.File(label="16-bit raw depth (can be considered as disparity)")
|
||||
submit = gr.Button("Submit")
|
||||
|
||||
@@ -88,7 +89,7 @@ with gr.Blocks(css=css) as demo:
|
||||
example_files.sort()
|
||||
example_files = [os.path.join('assets/examples', filename) for filename in example_files]
|
||||
examples = gr.Examples(examples=example_files, inputs=[input_image], outputs=[depth_image_slider, raw_file], fn=on_submit, cache_examples=False)
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
demo.queue().launch()
|
||||
Reference in New Issue
Block a user