Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,50 +1,29 @@
|
|
1 |
import gradio as gr
|
2 |
-
from video_processor import
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
with gr.Blocks() as app:
|
32 |
-
gr.Markdown("# π LBW DRS System\nUpload a video or simulate a live appeal.")
|
33 |
-
|
34 |
-
with gr.Tabs():
|
35 |
-
with gr.TabItem("π€ Upload Video"):
|
36 |
-
video_input = gr.Video(label="Upload LBW Video")
|
37 |
-
run_button = gr.Button("Analyze")
|
38 |
-
output_video = gr.Video(label="Replay with AI Overlays")
|
39 |
-
decision_text = gr.Textbox(label="Final Decision")
|
40 |
-
|
41 |
-
run_button.click(
|
42 |
-
fn=handle_upload,
|
43 |
-
inputs=[video_input],
|
44 |
-
outputs=[output_video, decision_text]
|
45 |
-
)
|
46 |
-
|
47 |
-
with gr.TabItem("πΊ Live Stream"):
|
48 |
-
live_info = gr.Textbox(value=handle_live_simulation(), label="Live System Status", interactive=False)
|
49 |
-
|
50 |
-
app.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
from video_processor import process_live_video, process_uploaded_video
|
3 |
+
|
4 |
+
def analyze_live_video():
|
5 |
+
result_path, decision = process_live_video()
|
6 |
+
return result_path, decision
|
7 |
+
|
8 |
+
def analyze_uploaded_video(video):
|
9 |
+
result_path, decision = process_uploaded_video(video)
|
10 |
+
return result_path, decision
|
11 |
+
|
12 |
+
with gr.Blocks(title="Smart LBW DRS System") as demo:
|
13 |
+
gr.Markdown("# π Smart LBW DRS System")
|
14 |
+
with gr.Tab("π‘ Live Match Review"):
|
15 |
+
gr.Markdown("Automatically captures last 10 seconds on LBW appeal and analyzes it.")
|
16 |
+
live_btn = gr.Button("Analyze Last 10s")
|
17 |
+
live_video = gr.Video(label="AI Annotated Replay")
|
18 |
+
live_text = gr.Textbox(label="Decision", interactive=False)
|
19 |
+
live_btn.click(fn=analyze_live_video, outputs=[live_video, live_text])
|
20 |
+
|
21 |
+
with gr.Tab("π€ Upload Review Clip"):
|
22 |
+
gr.Markdown("Upload a short clip with an LBW appeal.")
|
23 |
+
upload_input = gr.Video(label="Input Video")
|
24 |
+
upload_btn = gr.Button("Analyze Upload")
|
25 |
+
upload_output = gr.Video(label="AI Annotated Replay")
|
26 |
+
upload_text = gr.Textbox(label="Decision", interactive=False)
|
27 |
+
upload_btn.click(fn=analyze_uploaded_video, inputs=[upload_input], outputs=[upload_output, upload_text])
|
28 |
+
|
29 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|