Skip to main content

SportsLabKit

Introduction

Meet SportsLabKit: The essential toolkit for advanced sports analytics. Designed for pros and amateurs alike, we convert raw game footage into actionable data.

We're kicking off with soccer and expanding to other sports soon. Need to quantify your game? Make human movement computable with SportsLabKit.

Features

Core Capabilities

  • High-Performance Tracking: In-house implementations of SORT, DeepSORT, ByteTrack, and TeamTrack for object tracking in sports.

Flexibility

  • Plug-and-Play Architecture: Swap out detection and ReID models on the fly. Supported models include YOLOv8 and torch-ReID.

Usability

  • 2D Pitch Calibration: Translate bounding boxes to 2D pitch coordinates.

  • DataFrame Wrappers: BoundingBoxDataFrame and CoordinatesDataFrame for effortless manipulation and analysis of tracking data.

Tutorials

  • Get Started: Your first steps in understanding and setting up SportsLabKit.
  • User Guide: A comprehensive guide for effectively using the toolkit in real-world scenarios.
  • Core Components: Deep dive into the essential elements that make up SportsLabKit, including tracking algorithms and DataFrame wrappers.

Installation

To install SportsLabKit, simply run:

pip install SportsLabKit

Note: We're in active development, so expect updates and changes.

Example Usage

To get started with tracking your first game, follow this simple example:

import sportslabkit as slk

# Initialize your camera and models
cam = slk.Camera(path_to_mp4)
det_model = slk.detection_model.load('YOLOv8x')
motion_model = slk.motion_model.load('KalmanFilter')

# Configure and execute the tracker
tracker = slk.mot.SORTTracker(detection_model=det_model, motion_model=motion_model)
bbdf = tracker.track(cam)

# The tracking data is now ready for analysis

The output is a BoundingBoxDataFrame, a multi-level Pandas DataFrame that contains Team ID, Player ID, and various attributes like bounding box dimensions. Each row is indexed by Frame ID for easy analysis. The DataFrame is also customizable, allowing you to adapt Team and Player IDs as needed.

Example of BoundingBoxDataFrame

Roadmap

  • Better CV tools: Implement state of the art tracking methods, add event detection etc.

  • Unified Data Representation: In the pipeline are event data detection and a single DataFrame structure for both event and trajectory data.

  • Enhanced Compatibility: Upcoming support for data export to standard formats for easy integration with other tools.

Contributing

See the Contributing Guide for more information.

Contributors

All Contributors

Atom Scott
Atom Scott

🚧
Ikuma Uchida
Ikuma Uchida

✅

This project follows the all-contributors specification. Contributions of any kind welcome!

Related Papers

SoccerTrack:
A Dataset and Tracking Algorithm for Soccer with Fish-eye and Drone Videos

Atom Scott*, Ikuma Uchida*, Masaki Onishi, Yoshinari Kameda, Kazuhiro Fukui, Keisuke Fujii

Presented at CVPR Workshop on Computer Vision for Sports (CVSports'22). *Authors contributed equally.

See papers that cite SoccerTrack on Google Scholar.

Citation

@inproceedings{scott2022soccertrack,
  title={SoccerTrack: A Dataset and Tracking Algorithm for Soccer With Fish-Eye and Drone Videos},
  author={Scott, Atom and Uchida, Ikuma and Onishi, Masaki and Kameda, Yoshinari and Fukui, Kazuhiro and Fujii, Keisuke},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={3569--3579},
  year={2022}
}

Metadata

Release files for sportslabkit 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sportslabkit 0.3.1
File Size Uploaded
sportslabkit-0.3.1.tar.gz 152.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sportslabkit 0.3.1
File Interpreter ABI Platform
sportslabkit-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 333.9 kB

Release files / sportslabkit-0.3.1.tar.gz

Download URL sportslabkit-0.3.1.tar.gz
Size 152.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ea0fde6341af22685a892755c7aaf14a23f0157c6c3afc0a96585e7d4dea249d
BLAKE2b-256 checksum
How to use checksums
a08521f2c0bb7357eaa4ed67046fd405745398aef06c66826a99b8ac3d8dfc98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.12 Darwin/22.5.0

Release files / sportslabkit-0.3.1-py3-none-any.whl

Download URL sportslabkit-0.3.1-py3-none-any.whl
Size 181.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68a92d614f67d29f84faab6b7998a7e8b561170c3ad66f874486832592c9babe
BLAKE2b-256 checksum
How to use checksums
0768a4f9cbd0d943f9e9c9c2945fbca85093624ed9be7ec5f6958de40943f0ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.12 Darwin/22.5.0

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page