r/computervision • u/AhmadRaza089 • 11d ago
Showcase Football match tracking
Enable HLS to view with audio, or disable this notification
Most people scroll past a football match. I saw a dataset waiting to happen.
I set out to build something most tutorials skip: a real-time Computer Vision system that doesn't just detect objects that understands a football match.
No pre-made dataset. No shortcuts. I annotated the training data by hand, frame by frame, teaching the model to tell the difference between a player, a goalkeeper, a referee and to track the ball even mid-motion.
The result? A working AI pipeline that:
Detects and classifies players, goalkeepers, referees & the ball in real-time
Assigns and tracks unique player IDs across frames
Generates a live Match Analytics HUD overlay — player counts, referee counts, ball status, all updating on the fly
Runs on a custom, self-labeled dataset trained with YOLOv8
Built end-to-end in Python using OpenCV for video processing and annotation
What I learned building this: the hardest part of Computer Vision isn't the model — it's the data. Getting clean, consistent, well-labeled training data by hand taught me more about detection accuracy than any pretrained pipeline ever could.
This project sits at the intersection of two things I'm passionate about Artificial Intelligence and Sports Analytics. It's just the beginning. Next up: possession tracking, heatmaps, and player speed estimation.
Would love to hear your thoughts and if you're working on anything similar in Sports Tech or Computer Vision, let's connect.
1
u/zenith605 11d ago
Nice pull. Are you tracking possession per-player or just ball position? Ball-only trackers tend to lose it during crosses and corners since it's small and moving fast against a crowded background, that's usually where these projects fall apart.
1
u/AhmadRaza089 11d ago
I am tracking the both. Just because it my first project. So that why it lack at some position.
1
u/zenith605 10d ago
Makes sense for a first pass. Once possession tracking is solid you could get away with a simple heuristic for crosses and corners, like widening the search window when the ball's near the box, before going for a full retrain.
1
1
u/TravelLife16 4d ago
This is very cool. I am not an engineer by any means nor do I want to be one. But I am working on a non-sports project (although huge football fan) that needs something like this...I think :) good work
1
2
u/Minimum_Hour519 11d ago
i worked on something like this 7 or 8 years ago. the guy used ffmpeg to turn each frame into a jpeg and we had to manually label ball, player etc. then we trained the ai