nam_nguyenhoai_AI
Update application file
f799d96
raw
history blame
1.41 kB
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):
# Process the video and get the path of the output video
#output_video_path = make_video(uploaded_video,encoder=model_type)
pass
#return output_video_path
submit.click(on_submit, inputs=[input_video, model_type], outputs=processed_video)
#example_files = os.listdir('assets/examples_video')
#example_files.sort()
#example_files = [os.path.join('assets/examples_video', filename) for filename in example_files]
#examples = gr.Examples(examples=example_files, inputs=[input_video], outputs=processed_video, fn=on_submit, cache_examples=True)
if __name__ == '__main__':
demo.queue().launch()