The title of our project is Player Tracking in Bird-Eye Diagram Through Basketball Video
In the sport of basketball, analyzing gameplay and opposing team strategies can be challenging due to tilted camera angles in footage. Instant playbacks offer coaches a better perspective, enabling them to assess match dynamics, make real-time adaptations, and analyze games more effectively. This enhances decision-making, team success, and fan engagement. YOLOv5, a popular multi-object detection model, along with robust court mapping with ResNet18, plays a crucial role in accurately identifying players and positioning them on the detected court.
Original | Board |
---|---|
Related Paper:
- Maglo, Adrien, Astrid Orcesi, and Quoc-Cuong Pham. "KaliCalib: A Framework for Basketball Court Registration." Proceedings of the 5th International ACM Workshop on Multimedia Content Analysis in Sports. 2022.[PDF]
Create a virtual environment:
virtualenv venv
source venv/bin/activate
Install the dependancies:
pip install -r requirements.txt
Default run
python bird_eye_video.py
Change model
python bird_eye_video.py --modelPath models/model_challenge.pth
Change input video
python bird_eye_video.py --inputPath input/demo.mp4
Change weight
python bird_eye_video.py --weightPath yolov5/runs/train/exp2/weights/best.pt
Change floortexture
python bird_eye_video.py --floorTexturePath input/floor_texture/concrete.jpg
The dataset used in this study includes bounding box locations of players and referees, as well as court vertex locations. Due to challenges in collecting data from actual NBA games, data was gathered from NBA 2k19, ensuring controlled scenes with visible sidelines. This dataset improves court detection, player tracking, and model generalization.
The self-annotated dataset is opensourced in Roboflow
Original | Homography | Board |
---|---|---|
Original | Homography | Board |
---|---|---|
-
Project Document: [PDF]
-
Project Powerpoint: [PowerPoint]
[1] P. Kaarthick, “An automated player detection and tracking in basketball game,” Computers, Materials Continua, vol. 58, pp. 625–639, 01 2019.
[2] D. Farin, S. Krabbe, P. With, and W. Effelsberg, “Robust camera calibration for sport videos using court models,” vol. 5307, 01 2004, pp. 80–91.
[3] W.-L. Lu, “Learning to track and identify players from broadcast sports videos,” Ph.D. dissertation, University of British Columbia, 2011. Link
[4] G. Jocher, “YOLOv5 by Ultralytics,” May 2020. Link
[5] A. Maglo, A. Orcesi, and Q.-C. Pham, “Kalicalib: A framework for basketball court registration,” in Proceedings of the 5th International ACM Workshop on Multimedia Content Analysis in Sports, 2022, pp. 111–116.
[6] M. Martinez, C. Sitawarin, K. Finch, L. Meincke, A. Yablonski, and A. Kornhauser, “Beyond grand theft auto v for training, testing and enhancing deep learning in self driving cars,” arXiv preprint arXiv:1712.01397, 2017.
[7] P. Dwivedi. (2019) March madness — analyze video to detect players, teams, and who attempted the basket. Link
[8] Stephan. (2019) Open source sports video analysis using machine learning. Link
- Tien-Li Lin, Email: [email protected]
- Yi-Cheng Liu, Email: [email protected]
- Wei-Cheng Chiang, Email: [email protected]
Please cite the author's paper if you use the code in your work.
@inproceedings{maglo2022kalicalib,
title={KaliCalib: A Framework for Basketball Court Registration},
author={Maglo, Adrien and Orcesi, Astrid and Pham, Quoc-Cuong},
booktitle={Proceedings of the 5th International ACM Workshop on Multimedia Content Analysis in Sports},
pages={111--116},
year={2022}
}