Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,18 +1,15 @@
|
|
1 |
-
|
2 |
-
import
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
# Create and launch Gradio interface
|
18 |
-
gr.Interface(fn=gradio_video_processing, inputs=video_input, outputs=video_output, title="Fight Detection in Video").launch()
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from ProcessVideo import process_video
|
3 |
+
|
4 |
+
# Gradio function to handle the video upload and processing
|
5 |
+
def gradio_video_processing(video):
|
6 |
+
video_path = video.name # Gradio provides the uploaded video file path
|
7 |
+
output_video_path = process_video(video_path) # Process the video and get the output path
|
8 |
+
return output_video_path
|
9 |
+
|
10 |
+
# Gradio Interface
|
11 |
+
video_input = gr.inputs.Video(label="Upload a Video")
|
12 |
+
video_output = gr.outputs.Video(label="Processed Video with Labels")
|
13 |
+
|
14 |
+
# Create and launch Gradio interface
|
15 |
+
gr.Interface(fn=gradio_video_processing, inputs=video_input, outputs=video_output, title="Fight Detection in Video").launch()
|
|
|
|
|
|