File size: 1,290 Bytes
06f8492
333da55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
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
import gradio as gr
from video_processor import process_live_video, process_uploaded_video

def analyze_live_video():
    result_path, decision = process_live_video()
    return result_path, decision

def analyze_uploaded_video(video):
    result_path, decision = process_uploaded_video(video)
    return result_path, decision

with gr.Blocks(title="Smart LBW DRS System") as demo:
    gr.Markdown("# 🏏 Smart LBW DRS System")
    with gr.Tab("πŸ“‘ Live Match Review"):
        gr.Markdown("Automatically captures last 10 seconds on LBW appeal and analyzes it.")
        live_btn = gr.Button("Analyze Last 10s")
        live_video = gr.Video(label="AI Annotated Replay")
        live_text = gr.Textbox(label="Decision", interactive=False)
        live_btn.click(fn=analyze_live_video, outputs=[live_video, live_text])

    with gr.Tab("πŸ“€ Upload Review Clip"):
        gr.Markdown("Upload a short clip with an LBW appeal.")
        upload_input = gr.Video(label="Input Video")
        upload_btn = gr.Button("Analyze Upload")
        upload_output = gr.Video(label="AI Annotated Replay")
        upload_text = gr.Textbox(label="Decision", interactive=False)
        upload_btn.click(fn=analyze_uploaded_video, inputs=[upload_input], outputs=[upload_output, upload_text])

demo.launch()