Tracking Ball: volleyball tracking in amateur video

Tracking Ball: volleyball tracking in amateur video

2025/09/08

Fast volleyball tracking: real analytics at 200 FPS

Volleyball in motion

Volleyball is a dynamic sport where every detail of the ball's movement can be important for game analysis, coaching, or the creation of new sports technologies. Introducing Fast Volleyball Tracking Inference, a high-speed, real-time volleyball detection and tracking solution that runs at up to 200 frames per second (FPS) (fast model), even on a commodity Intel Core i5-10400F processor. This project, available on GitHub - Fast Volleyball Tracking Inference , ideal for determining ball trajectories on amateur videos with static camera placement

What is Fast Volleyball Tracking Inference?

It is a lightweight system based on the optimized ONNX model, which allows: - Detect and track volleyball in video at high speed. - Save ball coordinates to a CSV file for further analysis. - Optionally create a visualized video with the trajectory of the ball. - Run on a regular CPU, ensuring accessibility for a wide range of users.

The project uses grayscale video to optimize performance and achieves impressive processing speeds even on low-cost hardware.

Key benefits

  1. High performance: up to 200 FPS on Intel Core i5-10400F @ 2.90GHz.
  2. Optimized for CPU: Lightweight ONNX model that does not require powerful GPUs.
  3. Output flexibility: The coordinates of the ball are saved in CSV, for debugging you can visualize the process - optional.
  4. Ease of Use: User-friendly command line interface with customizable parameters.
  5. Open Source: The project is distributed under the MIT license, which allows you to freely use and modify it.

How to start using it?

Installation

To work with the project you will need: - Python 3.12 or higher. - Dependency manager uv. - Video file (for example, .mp4). - Pretrained weights of the ONNX model (download link is provided in the repository).

Installation steps: 1. Clone the repository:

git clone https://github.com/asigatchov/fast-volleyball-tracking-inference.git
cd fast-volleyball-tracking-inference
  
2. Install dependencies using uv:

uv sync
  1. Download the pretrained weights of the ONNX model (link available in the repository).

Launch

To process the video and get the coordinates of the ball, run the command:

uv run src/inference_onnx_seq9_gray_v2.py --video_path examples/beach_st_lenina_20250622_g1_005.mp4 --model_path models/VballNetFastV1_seq9_grayscale_233_h288_w512.onnx --output_dir output/

To visualize the ball's trajectory in real time, add the --visualize flag:

uv run src/inference_onnx_seq9_gray_v2.py --video_path examples/beach_st_lenina_20250622_g1_005.mp4 --model_path models/VballNetFastV1_seq9_grayscale_233_h288_w512.onnx --visualize

Imprint

  • CSV file: Contains the frame ID and ball coordinates (x, y). Example:
    Frame,Visibility,X,Y
    0,0,-1,-1
    1,1,1068,536
    2,1,1068,532
    ...
    
  • Video (optional): Visualization of the ball's trajectory, saved in the output/ folder.

Application

The project opens up many opportunities: - Sports Analytics: Study ball trajectories to improve strategies and training. - Determination of playing time - Research in computer vision: Development and testing of lightweight models for real time.

Technical details

  • Model architecture: Lightweight convolutional neural network (CNN), optimized for CPU operation.
  • Input data: Grayscale video to speed up processing.
  • Dependencies:
    • onnxruntime>=1.22.0
    • opencv-python>=4.12.0.88
    • pandas>=2.3.1
    • tqdm>=4.67.1

Conclusion

Fast Volleyball Tracking Inference is a tool for anyone interested in sports analytics or computer vision. Thanks to its high speed, ease of use and open source, the project is ideal for enthusiasts. Try it today by cloning the repository on GitHub - Fast Volleyball Tracking Inference !