Irpan commited on
Commit
a5e5e5e
·
1 Parent(s): af1ab42
Files changed (2) hide show
  1. app.py +11 -11
  2. test.py +5 -0
app.py CHANGED
@@ -80,15 +80,15 @@ def process_video(input_video):
80
 
81
  return output_path
82
 
83
- # Gradio Interface
84
- def create_gradio_interface():
85
- # Input: video file, Output: video file
86
- interface = gr.Interface(fn=process_video,
87
- inputs=gr.Video(label="Upload Video (mp4, avi, mov)"),
88
- outputs=gr.Video(label="Processed Video"))
89
-
90
- return interface
91
 
92
- if __name__ == '__main__':
93
- demo = create_gradio_interface()
94
- demo.launch()
 
 
 
 
 
 
 
 
 
80
 
81
  return output_path
82
 
 
 
 
 
 
 
 
 
83
 
84
+
85
+ # Gradio Interface
86
+ interface = gr.Interface(fn=process_video,
87
+ inputs=gr.Video(label="Upload Video (mp4, avi, mov)"),
88
+ outputs=gr.Video(label="Processed Video"),
89
+ live=False, # No live update to avoid real-time processing issues
90
+ title="Football Match Analysis with YOLO and OpenCV",
91
+ description="This tool processes sports game videos to track player movements, team assignments, ball possession, speed, distance, and camera movement.",
92
+ allow_download=True) # Allow users to download the processed video
93
+
94
+ interface.launch(debug=True, show_error = True)
test.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ desc = "description goes here"
2
+ gr.Interface(detect,
3
+ inputs = [gr.Video(format="mp4")],
4
+ outputs = gr.Video(format="mp4"),
5
+ title="Football Math Analysis with YOLO and OpenCV",description=desc).launch()