Aquibjaved commited on
Commit
eb376f2
·
verified ·
1 Parent(s): d964b6c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -18
app.py CHANGED
@@ -1,18 +1,15 @@
1
-
2
- import cv2
3
- import numpy as np
4
- import gradio as gr
5
- from ProcessVideo import process_video
6
-
7
- # Gradio function to handle the video upload and processing
8
- def gradio_video_processing(video):
9
- video_path = video.name # Gradio provides the uploaded video file path
10
- output_video_path = process_video(video_path) # Process the video and get the output path
11
- return output_video_path
12
-
13
- # Gradio Interface
14
- video_input = gr.inputs.Video(label="Upload a Video")
15
- video_output = gr.outputs.Video(label="Processed Video with Labels")
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()