Spaces:
Sleeping
Sleeping
import gradio as gr | |
from video_utils import process_video | |
from lbw_logic import decide_lbw | |
def analyze_and_decide(video): | |
prediction_path, replay_path, analysis_data = process_video(video) | |
decision = decide_lbw(analysis_data) | |
return decision, prediction_path, replay_path | |
with gr.Blocks() as demo: | |
gr.Markdown("## 🏏 LBW Analysis App - Upload or Record Video") | |
video_input = gr.Video(label="Upload or Record Delivery Video", source="upload", format="mp4") | |
with gr.Row(): | |
decision_out = gr.Textbox(label="Decision: OUT or NOT OUT") | |
prediction_vid = gr.Video(label="Predicted Trajectory Video") | |
analysis_vid = gr.Video(label="Analysis Replay") | |
btn = gr.Button("Analyze") | |
btn.click(analyze_and_decide, inputs=video_input, outputs=[decision_out, prediction_vid, analysis_vid]) | |
demo.launch() | |