DSatishchandra commited on
Commit
fd230fa
·
verified ·
1 Parent(s): 696c635

Update pages/live_match.py

Browse files
Files changed (1) hide show
  1. pages/live_match.py +4 -9
pages/live_match.py CHANGED
@@ -16,7 +16,7 @@ def create_lbw_ui():
16
  with gr.Blocks() as demo:
17
  gr.Markdown("### 🎥 GullyDRS - LBW Decision Review System")
18
 
19
- # Video input (removed source parameter)
20
  video_input = gr.Video(label="Upload a Match Video", interactive=True)
21
 
22
  # Pitch position slider
@@ -59,14 +59,9 @@ def create_lbw_ui():
59
 
60
  # Download button generates a downloadable file
61
  def download_clip(video_path):
62
- if video_input is None:
63
- return None, "Please upload a video.", None, None
64
- if pitch_position is None:
65
- pitch_position = 50 # Default pitch position
66
- result_clip_path, decision, ball_path_3d = ball_detection.process_lbw_detection(video_input, pitch_position)
67
- if not result_clip_path:
68
- return None, "Failed to process video.", None, None
69
- return result_clip_path, decision, ball_path_3d, None
70
 
71
  download_btn.click(
72
  fn=download_clip,
 
16
  with gr.Blocks() as demo:
17
  gr.Markdown("### 🎥 GullyDRS - LBW Decision Review System")
18
 
19
+ # Video input
20
  video_input = gr.Video(label="Upload a Match Video", interactive=True)
21
 
22
  # Pitch position slider
 
59
 
60
  # Download button generates a downloadable file
61
  def download_clip(video_path):
62
+ if video_path and os.path.exists(video_path):
63
+ return gr.File(label="Download Replay Clip", value=video_path)
64
+ return None
 
 
 
 
 
65
 
66
  download_btn.click(
67
  fn=download_clip,