Spaces:
Sleeping
Sleeping
Commit
·
e1f8629
1
Parent(s):
6c2ffca
latest changes
Browse files
app.py
CHANGED
@@ -173,14 +173,15 @@ def predict_video(video_path):
|
|
173 |
# --- 5. Gradio Interface Setup ---
|
174 |
iface = gr.Interface(
|
175 |
fn=predict_video,
|
176 |
-
|
|
|
177 |
outputs=gr.Video(label="Processed Video with Predictions"),
|
178 |
title="Real-time Violence Detection with SmallVideoClassifier",
|
179 |
description="Upload a video, and the model will analyze it for violence, displaying the predicted class and confidence on each frame.",
|
180 |
allow_flagging="never", # Disable flagging on Hugging Face Spaces
|
181 |
examples=[
|
182 |
# You can provide example video URLs or paths if you have them publicly available
|
183 |
-
#
|
184 |
]
|
185 |
)
|
186 |
|
|
|
173 |
# --- 5. Gradio Interface Setup ---
|
174 |
iface = gr.Interface(
|
175 |
fn=predict_video,
|
176 |
+
# Corrected: Removed 'type="filepath"' as it's not a valid argument for gr.Video
|
177 |
+
inputs=gr.Video(label="Upload Video for Violence Detection (MP4 recommended)"),
|
178 |
outputs=gr.Video(label="Processed Video with Predictions"),
|
179 |
title="Real-time Violence Detection with SmallVideoClassifier",
|
180 |
description="Upload a video, and the model will analyze it for violence, displaying the predicted class and confidence on each frame.",
|
181 |
allow_flagging="never", # Disable flagging on Hugging Face Spaces
|
182 |
examples=[
|
183 |
# You can provide example video URLs or paths if you have them publicly available
|
184 |
+
# e.g., "https://huggingface.co/datasets/gradio/test-files/resolve/main/video.mp4"
|
185 |
]
|
186 |
)
|
187 |
|