dschandra commited on
Commit
963c8cf
·
verified ·
1 Parent(s): c7f7a8e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -93,10 +93,10 @@ You'll get a 3D trajectory plot, annotated replay, and OUT/NOT OUT decision.
93
 
94
  def on_video_upload(video_file):
95
  if video_file is None:
96
- return None
97
  file_path = video_file.name if hasattr(video_file, "name") else video_file
98
  return save_uploaded_video(file_path, video_file)
99
-
100
  video_input.change(
101
  fn=on_video_upload,
102
  inputs=[video_input],
@@ -123,7 +123,6 @@ After recording or uploading a video, switch to the **LBW Review** tab and click
123
  trajectory_plot_output = gr.Image(label="3D Trajectory plot")
124
 
125
  def on_analyse(_):
126
- video_path = out_video_path.value
127
  if not video_path or not os.path.exists(video_path):
128
  return (
129
  "Please record or upload a video in the first tab.",
@@ -143,7 +142,7 @@ After recording or uploading a video, switch to the **LBW Review** tab and click
143
 
144
  analyse_button.click(
145
  fn=on_analyse,
146
- inputs=[analyse_button],
147
  outputs=[
148
  decision_output,
149
  ball_speed_output,
 
93
 
94
  def on_video_upload(video_file):
95
  if video_file is None:
96
+ return ""
97
  file_path = video_file.name if hasattr(video_file, "name") else video_file
98
  return save_uploaded_video(file_path, video_file)
99
+ video_output = gr.Textbox(visible=False)
100
  video_input.change(
101
  fn=on_video_upload,
102
  inputs=[video_input],
 
123
  trajectory_plot_output = gr.Image(label="3D Trajectory plot")
124
 
125
  def on_analyse(_):
 
126
  if not video_path or not os.path.exists(video_path):
127
  return (
128
  "Please record or upload a video in the first tab.",
 
142
 
143
  analyse_button.click(
144
  fn=on_analyse,
145
+ inputs=[video_output],
146
  outputs=[
147
  decision_output,
148
  ball_speed_output,