nam_nguyenhoai_AI commited on
Commit
f799d96
1 Parent(s): c89368e

Update application file

Browse files
Files changed (1) hide show
  1. app.py +48 -0
app.py CHANGED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import cv2
3
+ import os
4
+
5
+ css = """
6
+ #img-display-container {
7
+ max-height: 100vh;
8
+ }
9
+ #img-display-input {
10
+ max-height: 80vh;
11
+ }
12
+ #img-display-output {
13
+ max-height: 80vh;
14
+ }
15
+ """
16
+
17
+
18
+ title = "# Depth Anything Video Demo"
19
+ description = """Depth Anything on full video files."""
20
+
21
+ with gr.Blocks(css=css) as demo:
22
+ gr.Markdown(title)
23
+ gr.Markdown(description)
24
+ gr.Markdown("### Video Depth Prediction demo")
25
+
26
+ with gr.Row():
27
+ input_video = gr.Video(label="Input Video")
28
+ model_type = gr.Dropdown(["vits", "vitb", "vitl"], type="value", label='Model Type')
29
+ submit = gr.Button("Submit")
30
+ processed_video = gr.Video(label="Processed Video")
31
+
32
+ def on_submit(uploaded_video,model_type):
33
+
34
+ # Process the video and get the path of the output video
35
+ #output_video_path = make_video(uploaded_video,encoder=model_type)
36
+ pass
37
+ #return output_video_path
38
+
39
+ submit.click(on_submit, inputs=[input_video, model_type], outputs=processed_video)
40
+
41
+ #example_files = os.listdir('assets/examples_video')
42
+ #example_files.sort()
43
+ #example_files = [os.path.join('assets/examples_video', filename) for filename in example_files]
44
+ #examples = gr.Examples(examples=example_files, inputs=[input_video], outputs=processed_video, fn=on_submit, cache_examples=True)
45
+
46
+
47
+ if __name__ == '__main__':
48
+ demo.queue().launch()