owinymarvin commited on
Commit
e1f8629
·
1 Parent(s): 6c2ffca

latest changes

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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
- inputs=gr.Video(label="Upload Video for Violence Detection (MP4 recommended)", type="filepath"),
 
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
- # Example: "https://huggingface.co/datasets/gradio/test-files/resolve/main/video.mp4"
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