Spaces:
Runtime error
Runtime error
Commit
·
72d87fd
1
Parent(s):
1f8282c
Update app.py
Browse files
app.py
CHANGED
@@ -127,42 +127,30 @@ with app:
|
|
127 |
"""
|
128 |
)
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
with gr.Row():
|
131 |
-
# Left Column: Model Selection and Input
|
132 |
with gr.Column():
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
show_label=True,
|
137 |
-
value=DEFAULT_MODEL,
|
138 |
-
)
|
139 |
-
model_names_dropdown.change(fn=select_model, inputs=model_names_dropdown)
|
140 |
-
|
141 |
-
with gr.TabGroup() as tabs:
|
142 |
-
# Youtube URL Tab
|
143 |
-
with gr.Tab(label="Youtube URL"):
|
144 |
-
gr.Markdown("### **Provide a Youtube video URL**")
|
145 |
-
youtube_url = gr.Textbox(label="Youtube URL:", show_label=True)
|
146 |
-
youtube_url_predict_btn = gr.Button(value="Predict")
|
147 |
-
|
148 |
-
# Local File Tab
|
149 |
-
with gr.Tab(label="Local File"):
|
150 |
-
gr.Markdown("### **Upload a video file**")
|
151 |
-
video_file = gr.Video(label="Video File:", show_label=True)
|
152 |
-
local_video_predict_btn = gr.Button(value="Predict")
|
153 |
-
|
154 |
-
# Middle Column: Display Input Clip
|
155 |
with gr.Column():
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
)
|
160 |
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
|
167 |
# Examples and Prediction Buttons
|
168 |
gr.Markdown("**Examples:**")
|
|
|
127 |
"""
|
128 |
)
|
129 |
|
130 |
+
# Model Selection and Input
|
131 |
+
gr.Label("Model:")
|
132 |
+
model_names_dropdown = gr.Dropdown(
|
133 |
+
choices=VALID_VIDEOCLASSIFICATION_MODELS,
|
134 |
+
value=DEFAULT_MODEL,
|
135 |
+
)
|
136 |
+
model_names_dropdown.change(fn=select_model, inputs=model_names_dropdown)
|
137 |
+
|
138 |
+
# Tabs for Youtube URL and Local File
|
139 |
with gr.Row():
|
|
|
140 |
with gr.Column():
|
141 |
+
gr.Markdown("### **Provide a Youtube video URL**")
|
142 |
+
youtube_url = gr.Textbox(label="Youtube URL:")
|
143 |
+
youtube_url_predict_btn = gr.Button(value="Predict")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
with gr.Column():
|
145 |
+
gr.Markdown("### **Upload a video file**")
|
146 |
+
video_file = gr.Video(label="Video File:")
|
147 |
+
local_video_predict_btn = gr.Button(value="Predict")
|
|
|
148 |
|
149 |
+
# Display Input Clip
|
150 |
+
video_gif = gr.Image(label="Input Clip")
|
151 |
+
|
152 |
+
# Display Predictions
|
153 |
+
predictions = gr.Label(label="Predictions:", num_top_classes=5)
|
154 |
|
155 |
# Examples and Prediction Buttons
|
156 |
gr.Markdown("**Examples:**")
|