Coddieharsh commited on
Commit
bcb6a6d
·
1 Parent(s): a79962e

Tennis match analysis demo

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -1,4 +1,16 @@
1
  import gradio as gr
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  with gr.Blocks(title="Tennis Vision") as demo:
4
  gr.Markdown("""
@@ -11,10 +23,6 @@ with gr.Blocks(title="Tennis Vision") as demo:
11
  [📂 View Full Project on GitHub](https://github.com/HarshTomar1234/Tennis-Vision)
12
  """)
13
 
14
- gr.Video(
15
- value="https://raw.githubusercontent.com/HarshTomar1234/Tennis-Vision/main/output_videos/output_video.mp4",
16
- label="Tennis Vision Analysis Demo",
17
- autoplay=True
18
- )
19
 
20
  demo.launch()
 
1
  import gradio as gr
2
+ import urllib.request
3
+ import os
4
+
5
+ # Download video if not exists
6
+ video_path = "output_video.mp4"
7
+ if not os.path.exists(video_path):
8
+ print("Downloading video...")
9
+ urllib.request.urlretrieve(
10
+ "https://raw.githubusercontent.com/HarshTomar1234/Tennis-Vision/main/output_videos/output_video.mp4",
11
+ video_path
12
+ )
13
+ print("Download complete!")
14
 
15
  with gr.Blocks(title="Tennis Vision") as demo:
16
  gr.Markdown("""
 
23
  [📂 View Full Project on GitHub](https://github.com/HarshTomar1234/Tennis-Vision)
24
  """)
25
 
26
+ gr.Video(value=video_path, label="Tennis Vision Analysis Demo", autoplay=True)
 
 
 
 
27
 
28
  demo.launch()