Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,39 +1,3 @@
|
|
1 |
-
"""
|
2 |
-
Digital Review System (DRS) application for LBW decisions
|
3 |
-
========================================================
|
4 |
-
|
5 |
-
This application provides a simplified demonstration of how a cricket‑style
|
6 |
-
digital review system (DRS) could be implemented using open source
|
7 |
-
computer vision tools. It is not a complete Hawk‑Eye replacement, but
|
8 |
-
illustrates the key steps in building such a system: capturing video,
|
9 |
-
detecting and tracking the ball, estimating its flight trajectory,
|
10 |
-
analysing whether it would have hit the stumps, estimating speed and
|
11 |
-
generating a replay with annotations. A Gradio interface ties these
|
12 |
-
components together to provide an easy way to record a match, appeal
|
13 |
-
for an LBW decision and review the result.
|
14 |
-
|
15 |
-
The app has two main pages:
|
16 |
-
|
17 |
-
• **Live Match Recording** – allows the user to upload or record match video.
|
18 |
-
The video is stored on disk and can be analysed later.
|
19 |
-
|
20 |
-
• **LBW Review** – analyses the last few seconds of the recorded video
|
21 |
-
whenever an appeal is made. It performs ball tracking, trajectory
|
22 |
-
estimation and stumps intersection checks to predict whether the
|
23 |
-
batsman is out or not. An annotated replay and a 3D trajectory
|
24 |
-
visualisation are returned along with speed and impact information.
|
25 |
-
|
26 |
-
The implementation relies on simple background subtraction and circle
|
27 |
-
detection rather than proprietary tracking systems. It assumes a
|
28 |
-
single static camera behind the bowler and a fairly unobstructed view
|
29 |
-
of the pitch. See the individual modules in the ``modules`` package
|
30 |
-
for more details on each processing step.
|
31 |
-
|
32 |
-
Note: because this space is intended to run on Hugging Face, file
|
33 |
-
paths and heavy downloads are avoided wherever possible. The code is
|
34 |
-
fully self contained and uses only packages available in this runtime.
|
35 |
-
"""
|
36 |
-
|
37 |
"""
|
38 |
Digital Review System (DRS) application for LBW decisions
|
39 |
========================================================
|
@@ -195,4 +159,3 @@ After recording or uploading a video, switch to the **LBW Review** tab and click
|
|
195 |
if __name__ == "__main__":
|
196 |
demo = build_interface()
|
197 |
demo.launch()
|
198 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
"""
|
2 |
Digital Review System (DRS) application for LBW decisions
|
3 |
========================================================
|
|
|
159 |
if __name__ == "__main__":
|
160 |
demo = build_interface()
|
161 |
demo.launch()
|
|