The model weights and code were taken from the WASB-SBDT GitHub Repository. Extending their codebase to allow the use of these pre-trained models for inference.
This repository contains scripts for running inference on various models for tracking and segmentation tasks. The main script, main.py, allows users to specify model weights, select a model, and provide an input file or folder for processing. The models are designed to work with either tennis or badminton weights and can utilize CUDA if available.
Refer to the WASB_SBDT Model Zoo for download links for the model architectures and sports provided above.
Install the required packages using pip install -r requirements.txt
.
The main script, main.py, can be executed from the command line with the following options:
python main.py --weights tennis --model deepball --input path/to/input/video.mp4
wasb-sbdt-inference/
│
├── main.py
├── model_definitions/
│ ├── __init__.py
│ ├── ballseg.py
│ ├── deepball.py
│ ├── deepball_large.py
│ ├── monotrack.py
│ ├── restracknetv2.py
│ ├── tracknetv2.py
│ └── wasb.py
├── inference_scripts/
│ ├── ballseg_inference.py
│ ├── deepball_inference.py
│ ├── deepball_large_inference.py
│ ├── monotrack_inference.py
│ ├── restracknetv2_inference.py
│ ├── tracknetv2_inference.py
│ └── wasb_inference.py
└── model_weights/
└── badminton_wasb_best.pth.tar
└── other_model_weights.pth.tar
Place your model weights in the model_weights directory. The script will automatically select the correct weight file based on the specified --weights and --model options.
The scripts will utilize CUDA for inference if available. If CUDA is not available, the scripts will fall back to using the CPU.