|
import gradio as gr |
|
import cv2 |
|
import os |
|
|
|
css = """ |
|
#img-display-container { |
|
max-height: 100vh; |
|
} |
|
#img-display-input { |
|
max-height: 80vh; |
|
} |
|
#img-display-output { |
|
max-height: 80vh; |
|
} |
|
""" |
|
|
|
|
|
title = "# Depth Anything Video Demo" |
|
description = """Depth Anything on full video files.""" |
|
|
|
with gr.Blocks(css=css) as demo: |
|
gr.Markdown(title) |
|
gr.Markdown(description) |
|
gr.Markdown("### Video Depth Prediction demo") |
|
|
|
with gr.Row(): |
|
input_video = gr.Video(label="Input Video") |
|
model_type = gr.Dropdown(["vits", "vitb", "vitl"], type="value", label='Model Type') |
|
submit = gr.Button("Submit") |
|
processed_video = gr.Video(label="Processed Video") |
|
|
|
def on_submit(uploaded_video,model_type): |
|
|
|
|
|
|
|
pass |
|
|
|
|
|
submit.click(on_submit, inputs=[input_video, model_type], outputs=processed_video) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
demo.queue().launch() |