Real-time computer vision system for football tactical analysis. Detects players, referees, and ball, predicts team affiliations based on jersey colors, and maps player positions onto a tactical field for visualization and strategy.
git clone https://github.com/masfaatanveer/Football-Tactical-Analysis-CV.git
pip install -r requirements.txt
streamlit run main.pyIf you download the ZIP, unzip the code → install requirements → and run the command below:
streamlit run main.pyThe app will launch locally in your browser and show the real-time football analytics dashboard.
- YOLOv8-based detection of players, ball, referees
- Team prediction using LAB color space & dominant jersey colors
- Homography transformation to map player positions onto a 2D tactical field
- Streamlit-based fast web interface
- Ball tracking with position history
- Side-by-side tactical map & annotated video frame
| Feature | Metric / Value |
|---|---|
| Player Detection | 98.2% mAP@0.5 |
| Team Prediction | 92.4% accuracy (LAB space) |
| Keypoint Detection | 95.4% precision (YOLOv8-m) |
| Ball Tracking | 87 FPS (RTX 3060) |
| Homography | RMSE: 3.2 px |
| Model | Dataset | Epochs | Augmentation Techniques |
|---|---|---|---|
| YOLOv8 (Players) | Custom | 150 | Mosaic, MixUp, Rotation |
| YOLOv8 (Field) | Custom (keypoints) | 200 | Perspective, Resize, Shear |
| Team Color Logic | Manual Annotated | - | LAB color extraction + compare |
Masfa Tanveer
📩 masfaatanveerr@gmail.com
🔗 GitHub
Distributed under the MIT License.