{"id":21090880,"url":"https://github.com/shivxmr/football_analysis","last_synced_at":"2026-04-11T08:03:00.122Z","repository":{"id":258834987,"uuid":"827796303","full_name":"shivxmr/football_analysis","owner":"shivxmr","description":"AI/ML Football Analysis system with YOLO, OpenCV, and Python","archived":false,"fork":false,"pushed_at":"2024-10-21T10:23:44.000Z","size":6113,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T06:22:06.323Z","etag":null,"topics":["football","object-detection","opencv","python","roboflow","yolov5"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shivxmr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-12T11:49:20.000Z","updated_at":"2024-10-29T11:40:52.000Z","dependencies_parsed_at":"2024-11-20T00:31:45.547Z","dependency_job_id":null,"html_url":"https://github.com/shivxmr/football_analysis","commit_stats":null,"previous_names":["shivxmr/football_analysis"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shivxmr/football_analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivxmr%2Ffootball_analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivxmr%2Ffootball_analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivxmr%2Ffootball_analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivxmr%2Ffootball_analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shivxmr","download_url":"https://codeload.github.com/shivxmr/football_analysis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shivxmr%2Ffootball_analysis/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267585826,"owners_count":24111577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["football","object-detection","opencv","python","roboflow","yolov5"],"created_at":"2024-11-19T21:41:12.498Z","updated_at":"2026-04-11T08:03:00.049Z","avatar_url":"https://github.com/shivxmr.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Football Analysis Project\n\n## Introduction\nThe goal of this project is to detect and track players, referees, and footballs in a video using YOLO, a highly efficient AI object detection model. The model is trained to enhance its performance. Players are assigned to teams based on the colors of their t-shirts by applying K-means for pixel segmentation and clustering. This information is used to calculate each team's ball possession percentage during a match. Optical flow is utilized to measure camera movement between frames, ensuring accurate player movement tracking. Perspective transformation is implemented to account for the scene's depth and perspective, allowing player movement to be measured in meters rather than pixels. Additionally, the project calculates the speed of players and the distance they cover. This approach covers multiple key concepts in machine learning and addresses practical, real-world challenges, making it applicable for both beginners and experienced engineers.\n\n![Screenshot](output_videos/screenshot.png)\n\n## Modules Used\nThe following modules are used in this project:\n- YOLO: AI object detection model\n- Kmeans: Pixel segmentation and clustering to detect t-shirt color\n- Optical Flow: Measure camera movement\n- Perspective Transformation: Represent scene depth and perspective\n- Speed and distance calculation per player\n\n## Trained Models\n- [Trained Yolo v5](https://drive.google.com/file/d/1DC2kCygbBWUKheQ_9cFziCsYVSRw6axK/view?usp=sharing)\n\n## Sample video\n-  [Sample input video](https://drive.google.com/file/d/1t6agoqggZKx6thamUuPAIdN_1zR9v9S_/view?usp=sharing)\n\n## Requirements\nTo run this project, you need to have the following requirements installed:\n- Python 3.x\n- ultralytics\n- supervision\n- OpenCV\n- NumPy\n- Matplotlib\n- Pandas\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshivxmr%2Ffootball_analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshivxmr%2Ffootball_analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshivxmr%2Ffootball_analysis/lists"}