Padel Analysis
Reading a padel match filmed by a single TV camera: the players, the ball, every contact and what the ball hit, then the statistics of the game.
Personal project · Open source

- Role
- Solo, from design to release
- Data
- Two 2022 World Padel Tour finals, 1920×1080 at 30 fps
- Ground truth
- More than 2,000 contacts marked by hand
- Hardware
- A GTX 1650, post-match analysis
Key points
- 82 to 83% of contacts recognised with the right surface on minutes never seen, against 62% for hand-tuned rules
- 86% on a rally from another tournament, filmed in another venue, without retraining anything
- Over a whole match: points exact, a pair's distance within 1.3%, strokes within 1.2%
- Player tracking constrained by the court: IDF1 of 0.82, against 0.28 for plain ByteTrack on the same frames
The walkthrough
How it works
- 1
The court in three dimensions
A few court points clicked on the image are enough to calibrate it: the camera's position and orientation follow. A single camera cannot see depth, but at the moment of a contact the ball sits on a known surface, the floor or a glass panel. The ray from the camera through the ball's pixel meets that surface at a single point, which places the impact in three dimensions.
- 2
The players
YOLO pose detects every person and their skeleton. The point between the ankles, projected onto the floor, gives the position in metres. Tracking holds exactly four slots, two on each side of the net, and refuses any position outside the court. Without these constraints, ByteTrack exceeds four tracks on more than one frame in two: the detector sees far more people than the four players.
- 3
The ball
The ball is a few pixels wide and drowns among dozens of candidates. Rather than looking for it frame by frame, the project keeps the best candidates of every frame and chooses, by dynamic programming, the most plausible path over the whole sequence. Recall rises from 16% to 72%, then to 80% with a detection network trained for the purpose.
- 4
Contacts and their surface
A small temporal network, trained on minutes marked by hand, decides every contact and its surface from the trajectory, the players' gestures and the court geometry; eighteen networks vote together. Glass contacts the picture does not show are inferred from physics: a ball too slow to have reached the player directly after its bounce went via the glass, which holds 13 times out of 14.
- 5
The statistics
Play is cut into rallies. The scoreboard, read off the picture, gives the points, credited to the last striker, and says when the pairs change ends. Then come, per player over a rally and per pair over a match, distance covered, speed, time at the net, strokes and volleys.
Where it started
Computer vision analyses of tennis detect the players and the ball, then derive statistics from them. Padel adds a question tennis never asks: the ball bounces off glass and mesh, and a single rally chains volleys, bounces and shots played after the glass. Knowing what the ball hit, at every contact, becomes the heart of the problem. I ran this project alone, on the pictures of a TV broadcast and with no other sensor, with one rule set from the start: only publish a figure if it was measured on minutes never looked at during tuning.
Why padel is a hard case
A broadcast is not filmed for analysis: the camera is far away and high up, and the ball crosses the picture in moments.
- The ball is only a few pixels wide, often blurred, sometimes hidden by a player
- At the back of the court, a bounce off the glass moves the ball by only a few pixels in the picture
- A single camera cannot see depth: a high ball near the net and a ball on the floor at the back can land on the same pixel
- The crowd and the people around the court are silhouettes to the detector too
- The broadcast cuts and splices shots, and the players' identities have to survive those splices
Technical choices
Every building block was measured against a simpler method, kept in the code so the comparison stays possible.
- Constrained tracking rather than plain ByteTrack: four fixed slots and a court to respect take IDF1 from 0.28 to 0.82 on the same frames
- The ball chosen over the whole sequence rather than frame by frame: greedy growth decides locally and never goes back, global optimisation can revisit a choice
- A learned model rather than rules: on 716 marked contacts, 62% right surfaces for hand-tuned rules, 78% for the network, 83% with the glass physics and the ensemble of eighteen networks
- The AGPL-3.0 licence, imposed by Ultralytics: the code is open, but it cannot go into a proprietary product
Measuring honestly
A good share of the work went into measurement itself. A figure is only published if it was obtained on minutes that nothing had looked at during tuning.
- Judge minutes, marked by hand and scored only once. When cross-validation promised 87% and a fresh judge answered 82%, 82% is the figure kept
- An identity ground truth built automatically reported zero player swaps; arbitrated by hand, it counts four. The reference rested on the same assumption as the tracker under test, and IDF1 was overestimated by 0.137
- Match statistics checked one by one: movement against the dataset's annotated positions, strokes against the marked minutes, points against the scoreboard
- A rally from another tournament, in another venue, to check the model had not learned a single venue: 76 right contacts out of 88
What did not work
Two attempts failed. They are still described in full in the repository's evaluation report, with their measurements.
- Correcting contacts with the rules of padel: none was kept. Half of the bounces they inferred were real volleys, since the bandeja and the víbora are played in the air, far from the net
- Recovering by sound the glass contacts the picture does not show: the missed ones are silent in the recording, the broadcast microphone does not pick up what the camera does not see
What the project does not do yet
- It analyses after the match, at a few frames per second on a GTX 1650
- At the back of the court, a third of glass bounces are still missed
- Transfer to another court is shown on one rally, not on a whole match
- Player identity is still lost at broadcast splices
- Mesh and net are too rare in the data to be learned
What I took away
- A metric is only as good as its reference: a ground truth built on the same assumption as the system under test cannot see its errors
- Keep a simple, measured method next to every building block, to know what the block really adds
- Report the less flattering figure when two measurements disagree, and explain why
- Ship end to end: tests and continuous integration, documentation in two languages, a release with the trained weights, a licence for the annotated data
Gallery
1/4 · Right surfaces, hand-tuned rules against the learned model, on cross-validation and three judges



