Spaces:
Runtime error
Runtime error
Commit
·
c0f4f61
1
Parent(s):
fc3d5a3
Update app.py
Browse files
app.py
CHANGED
@@ -108,6 +108,12 @@ def model_interface(uploaded_video, activity):
|
|
108 |
|
109 |
return concatenated_image, results_probs, results_logits, [likely_label, likely_probability]
|
110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
iface = gr.Interface(
|
112 |
fn=model_interface,
|
113 |
inputs=[
|
@@ -122,7 +128,8 @@ iface = gr.Interface(
|
|
122 |
],
|
123 |
title="Engagify's Advanced Image Recognition Suite",
|
124 |
description="[[V0.5.1] Video Action Recognition - Copyright Engajify 2023] [Author: Ibrahim Ali] [Method: XCLIP ZERO SHOT / SAMPLED FRAMES = 32]",
|
125 |
-
live=False
|
|
|
126 |
)
|
127 |
|
128 |
iface.launch()
|
|
|
108 |
|
109 |
return concatenated_image, results_probs, results_logits, [likely_label, likely_probability]
|
110 |
|
111 |
+
video_folder = "Action Detection Samples"
|
112 |
+
video_files = [os.path.join(video_folder, file) for file in os.listdir(video_folder) if file.endswith('.mp4')] # considering only mp4 files
|
113 |
+
|
114 |
+
# Create examples: assuming every video is about 'dancing'
|
115 |
+
examples = [(video, "dancing") for video in video_files]
|
116 |
+
|
117 |
iface = gr.Interface(
|
118 |
fn=model_interface,
|
119 |
inputs=[
|
|
|
128 |
],
|
129 |
title="Engagify's Advanced Image Recognition Suite",
|
130 |
description="[[V0.5.1] Video Action Recognition - Copyright Engajify 2023] [Author: Ibrahim Ali] [Method: XCLIP ZERO SHOT / SAMPLED FRAMES = 32]",
|
131 |
+
live=False,
|
132 |
+
examples=examples # Add examples to the interface
|
133 |
)
|
134 |
|
135 |
iface.launch()
|