Update app.py
Browse files
app.py
CHANGED
@@ -78,11 +78,22 @@ with gr.Blocks(theme=gr.themes.Base()) as demo:
|
|
78 |
|
79 |
with gr.Row():
|
80 |
with gr.Column(scale=1):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
video_file = gr.File(label="Upload Video")
|
82 |
process_button = gr.Button("Process Video")
|
83 |
process_output = gr.Textbox(label="Status", lines=2)
|
84 |
|
85 |
-
gr.Markdown(
|
|
|
|
|
|
|
|
|
86 |
|
87 |
search_type = gr.Radio(["Text", "Image"], label="Search Type", value="Text")
|
88 |
text_input = gr.Textbox(label="Text Query")
|
@@ -92,16 +103,16 @@ with gr.Blocks(theme=gr.themes.Base()) as demo:
|
|
92 |
|
93 |
with gr.Column(scale=2):
|
94 |
results_gallery = gr.Gallery(label="Search Results", columns=3)
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
|
106 |
def update_search_input(choice):
|
107 |
return gr.update(visible=choice=="Text"), gr.update(visible=choice=="Image")
|
|
|
78 |
|
79 |
with gr.Row():
|
80 |
with gr.Column(scale=1):
|
81 |
+
|
82 |
+
gr.Markdown(
|
83 |
+
"""
|
84 |
+
<h3>1. Insert video</h3>
|
85 |
+
---
|
86 |
+
""")
|
87 |
+
|
88 |
video_file = gr.File(label="Upload Video")
|
89 |
process_button = gr.Button("Process Video")
|
90 |
process_output = gr.Textbox(label="Status", lines=2)
|
91 |
|
92 |
+
gr.Markdown(
|
93 |
+
"""
|
94 |
+
<h3>2. Search video frames</h3>
|
95 |
+
---
|
96 |
+
""")
|
97 |
|
98 |
search_type = gr.Radio(["Text", "Image"], label="Search Type", value="Text")
|
99 |
text_input = gr.Textbox(label="Text Query")
|
|
|
103 |
|
104 |
with gr.Column(scale=2):
|
105 |
results_gallery = gr.Gallery(label="Search Results", columns=3)
|
106 |
+
|
107 |
+
gr.Examples(
|
108 |
+
examples=[
|
109 |
+
["bangkok.mp4"],
|
110 |
+
["lotr.mp4"],
|
111 |
+
["mi.mp4"],
|
112 |
+
],
|
113 |
+
inputs=[video_file],
|
114 |
+
fn=process_video
|
115 |
+
)
|
116 |
|
117 |
def update_search_input(choice):
|
118 |
return gr.update(visible=choice=="Text"), gr.update(visible=choice=="Image")
|