Spaces:
Sleeping
Sleeping
Update pages/live_match.py
Browse files- pages/live_match.py +5 -1
pages/live_match.py
CHANGED
|
@@ -2,6 +2,10 @@ import gradio as gr
|
|
| 2 |
from gully_drs_core import ball_detection, video_utils, replay_utils
|
| 3 |
|
| 4 |
def record_or_upload_video(video_input, pitch_position):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
# Handle video input (either upload or recording)
|
| 6 |
video_path = video_input.name if hasattr(video_input, 'name') else video_input
|
| 7 |
|
|
@@ -19,7 +23,7 @@ def create_lbw_ui():
|
|
| 19 |
video_input = gr.Video(label="Upload or Record a Match Video", type="filepath", interactive=True)
|
| 20 |
|
| 21 |
# Slider for wickets pitch setup
|
| 22 |
-
pitch_position = gr.Slider(minimum=0, maximum=100, label="Set Wickets Pitch", value=50) #
|
| 23 |
|
| 24 |
# Button to process the video and make LBW decision
|
| 25 |
process_btn = gr.Button("🚨 Start LBW Detection")
|
|
|
|
| 2 |
from gully_drs_core import ball_detection, video_utils, replay_utils
|
| 3 |
|
| 4 |
def record_or_upload_video(video_input, pitch_position):
|
| 5 |
+
# Ensure pitch_position is not None
|
| 6 |
+
if pitch_position is None:
|
| 7 |
+
pitch_position = 50 # Set to a default value if None (e.g., 50%)
|
| 8 |
+
|
| 9 |
# Handle video input (either upload or recording)
|
| 10 |
video_path = video_input.name if hasattr(video_input, 'name') else video_input
|
| 11 |
|
|
|
|
| 23 |
video_input = gr.Video(label="Upload or Record a Match Video", type="filepath", interactive=True)
|
| 24 |
|
| 25 |
# Slider for wickets pitch setup
|
| 26 |
+
pitch_position = gr.Slider(minimum=0, maximum=100, label="Set Wickets Pitch", value=50) # Default value is 50
|
| 27 |
|
| 28 |
# Button to process the video and make LBW decision
|
| 29 |
process_btn = gr.Button("🚨 Start LBW Detection")
|