Skip to content

Anglui/basketball-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basketball Tracker using YOLOv8

This is a command-line tool used to draw bounding boxes around players, basketballs, and referees.

Installation

  1. Clone the repo:
git clone https://github.com/yourusername/basketball-tracker.git
cd basketball-tracker
  1. Create a virtual environment
python3 -m venv venv
source venv/bin/activate
  1. Install dependencies
pip install -r requirements.txt

Usage

python detector.py \
--source /path/to/game.mp4 \
--model /path/to/basketball_tracker.pt \ 
--output_dir /path/to/annotated_videos \
--confidence 0.5 
  • --source (-s): Path to the input video file
  • --model (-m): Path to model weights
  • --output_dir (-o): Directory to save annotated videos
  • --confidence (-c): Minimum confidence threshold required to draw bounding boxes (0 - 1)


Before annotation:
Before Annotation

After annotation:
After Annotation

Summary of Project

The aim of this project was to analyze the effects of downscaling and background subtraction on the inference accuracy of YOLOv8. 1408 frames at 1080p were annotated and used in training. The experiment looked at two values of 'imgsz' parameter: 640 (default) and 1920. It also looked at training with and without a Gaussian Mixed Model subtraction mask applied to the images. Overall four pair groups:


  1. 640 w/o mask
  2. 640 w/ mask
  3. 1920 w/o mask
  4. 1920 w/ mask

GMM Background Subtraction Mask Applied:
Mask Applied

At lower resolutions, the mask helped improve performance metrics across the board. However, at higher resolutions, the mask had no statistically significant effect. Moreover, the models that did not downscale the images performed better. Therefore, the model used for this tool is the one with no downscaling and no mask, i.e., model 3.

Author & Contact

Luis Angeles Feel free to open issues or pull requests.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages