iOS · Vision · Core ML
Freekick AI
A radar gun costs a few thousand dollars and measures one number. Freekick AI measures the speed, launch angle and type of a soccer shot from a single iPhone camera — no sensors on the ball, no second device, no server.
The problem
Measuring a struck ball is normally a hardware problem. Radar guns, doppler sensors, instrumented balls, multi-camera rigs — all of them solve it by adding equipment to the pitch, and all of them put the measurement out of reach of someone who just wants to know how hard they hit it.
A phone already has a 60 fps camera and a neural engine. The hard part isn't capture, it's that a camera has no idea how big anything is. A ball crossing forty pixels in one frame could be a screamer thirty yards out or a tap-in from six. Without a scale reference, pixels per frame is not a speed.
Using the goal as a ruler
The solution the app leans on: a regulation goal is 7.32 metres wide, everywhere in the world. If you can find the goal in the frame, you have a known length to measure everything else against.
A custom Core ML object detector locates the goal during setup. From its observed width in pixels, similar triangles give the camera-to-goal distance, and from there the pixel-to-metre scale at the plane the ball is travelling through. The ball's trajectory, tracked in pixels, becomes a trajectory in metres per second.
The honest caveat: that calculation needs the camera's horizontal field of view, and the app currently assumes 65° rather than reading it from the capture device. Modern iPhones sit between 60° and 68° at 1×, so the estimate lands within a couple of yards — good enough for distance context, and a known piece of future work to plumb the real value through from AVCaptureDevice.
How a shot gets measured
-
1
Find the goal
A Core ML detector trained on goal footage locates the frame during setup, and the app holds that reference for the session.
-
2
Track the ball
VNDetectTrajectoriesRequestfollows the ball across a fifteen-point window, fitting the parabola that a struck ball actually travels along. Objects that don't move parabolically get discarded, which is what keeps a jogging teammate from registering as a shot. -
3
Watch the striker
VNDetectHumanBodyPoseRequestreads the player's joints in parallel with the ball. The pose stream feeds a Core ML action classifier over a 120-frame window — roughly two seconds of body mechanics around the moment of contact. -
4
Derive the numbers
Exit velocity comes off the first frames after contact, total velocity from the full flight, and the launch angle from the ball's departure from the ground. Scaled by the goal, they stop being pixel measurements and become miles per hour and degrees.
-
5
Classify the strike
Physics and the model vote. Rules over the velocity profile separate a laces-driven power shot from a dipping instep finish — a ball that leaves fast but sheds more than 40% of its pace by the end of flight has the spin signature of curl, not a straight drive. The action classifier can override with a trivela call, but only above a higher confidence bar, because it is overturning what the physics already decided.
What comes out
Shots are scored, with bonuses for finding a top corner, and a session ends in a summary of every trajectory alongside average speed and angle. Sessions are recorded, so a shot that felt good can be checked against what actually happened.
Decisions worth defending
- Everything runs on the device
- There is not a single network call in the app. No account, no analytics, no backend. Both models ship inside the binary and run on the neural engine, which keeps it working on a pitch with no signal and makes the privacy policy short enough to actually read.
- Say “unsure” rather than guess
- When the classifier's top class doesn't clear its confidence threshold, the app shows
???instead of crowning whichever label happened to win by a hair. A wrong confident answer costs more trust than an honest blank one. - Physics first, model second
- The velocity profile is a stronger signal than the pose model for most shots, so the rules decide by default and the model only overrides where it genuinely knows better. Hybrid beat either half alone.
- Tuned against real footage
- The thresholds separating power from finesse — the exit-velocity floor, the deceleration ratio that marks a dipping ball — came from watching real shots fail to classify correctly and moving the numbers until they did.
- Swift
- UIKit
- AVFoundation
- Vision
- Core ML
- Create ML
Get it
Freekick AI 1.0 is built and running on device; the App Store listing is in progress.
Support
Questions, bugs and feature requests go to freekickapp@icloud.com.
For the best results, set the phone down in landscape with the whole goal in frame and follow the setup prompts. If goal detection struggles with your particular goal, send a photo of it taken from where the phone sits — that footage is what the detector gets tuned against.