Skip to main content

OpenSTARLab PhaseLearn Modeling package

Documentation Status dm ArXiv Discord

Introduction

The OpenSTARLab PhaseLearn package is the fundamental library for modeling and analyzing play phases in sports. It provides a robust framework to train and perform inference on play phases using state-of-the-art spatio-temporal architectures.

Key Concepts

image


Installation

  • Install pytorch (recommended version 2.4.0 linux pip python3.9 cuda11.8)
pip install torch torchvision torchaudio
  • To install this package via PyPI
pip install openstarlab-phaselearn
  • To install manually
git clone git@github.com:open-starlab/PhaseLearn.git
cd ./PhaseLearn
pip install -e .

Quick Start

Get started with inference using pre-trained models.

  1. Download Pre-trained Model: Download the model weights from MODEL URL and place them in the model/ directory.

  2. Generate Phase Data: Before estimating, you must convert the raw tracking into the Phase Data format.

  3. Run Inference: Perform phase estimation on your data.

Training and Analysis from Scratch

Follow these steps to train your own play phase model using the SoccerTrack-v2 dataset.

  1. Data Acquisition:

    • Tracking Data: Obtain the raw data from SoccerTrack-v2.
    • Phase Annotation Data: Download the play phase annotation data from DATA URL and place them in the data/ directory.
  2. Generate Phase Data: Before training, you must convert the raw tracking into the Phase Data format.

  3. Training & Evaluation: Once the data is prepared, you can execute the training pipeline.

Repository Layout

PhaseLearn/
├── phase/sports/soccer/         
│   ├── dataloaders/data_module.py
│   ├── inference/inference.py
│   ├── main_class_soccer/main.py
│   ├── models/
│   │   ├── model_yaml/
│   │   │   ├── train_baller2vec.yaml
│   │   │   ├── train_gat_transformer.yaml
│   │   │   ├── train_gcn_transformer.yaml
│   │   │   └── train_transformer.yaml
│   │   ├── baller2vec.py
│   │   ├── gat_transformer.py
│   │   ├── gcn_transformer.py
│   │   └── transformer.py
│   ├── trainers/train.py
│   └── utils/
│       ├── evaluation.py
│       ├── load_train_data.py
│       └── preprocessing.py
├── data/                              # Data storage (gitignored except .gitkeep)
│   ├── phase_annotation_data/
│   │   ├── 117092/
│   │   │   ├── 117092_00_01-04_18_annotation
│   │   │   ├── ...
│   │   ├── ...
│   ├── phase_data/
│   │   ├── bepro/
│   │   │   ├── 117092/117092_main_data
│   │   │   ├── ...
│   │   └── statsbomb_skillcorner/
│   │       ├── 3894537_1018887/3894537_1018887_main_data
│   │       ├── ...
│   └── train_data/bepro/              # generated by preprocessing_data()
│       ├── label_np.bpy
│       └── sequence_np.bpy
└── model/                              # Model storage (gitignored except .gitkeep)
    ├── baller2vec/
    │   ├── ...
    ├── gat_transformer/
    │   ├── 2team_mode/
    │   │   ├── 20251221_155257/run1
    │   │   │   ├── best.pth
    │   │   │   ├── hyperparameters.json
    │   │   │   ├── loss.csv
    │   │   │   └── model_stats.txt
    │   │   ├── ...
    │   ├── ...
    ├── gcn_transformer/
    │   ├── ...
    └── trnsformer/
        ├── ...

RoadMap

  • Release the package
  • Provide pre-trained models
  • Provide phase dataset

Other Information

Development torch version

version 0.0.2 linux pip python3.9 cuda11.8 

Citation

If you use phaselearn modeling in your research, please cite it as follows:

@article{playphase,
  title={Estimating Probability Distributions of FIFA-Defined Phases of Play Based on Inter-Analyst Diversity},
  author={Kento Kuroda, Keisuke Fujii and Yoshinari Kameda},
  journal={International Journal of Computer Science in Sport},
  year={2026},
  volume={XX},
  pages={XXX-XXX},
  publisher={Publisher}
}

Developer

Kento Kuroda
Kento Kuroda

💻
Kenjiro Ide
Kenjiro Ide

💻
Keisuke Fujii
Keisuke Fujii

🧑‍💻

Metadata

Release files for openstarlab-phaselearn 0.0.2

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

Source distribution (sdist)

Source distribution for openstarlab-phaselearn 0.0.2
File Size Uploaded Provenance Actions
openstarlab_phaselearn-0.0.2.tar.gz 30.2 kB Without provenance Details for openstarlab_phaselearn-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openstarlab-phaselearn 0.0.2
File Interpreter ABI Platform Actions
openstarlab_phaselearn-0.0.2-py3-none-any.whl Python 3 none any Details for openstarlab_phaselearn-0.0.2-py3-none-any.whl

Total release size: 70.3 kB

Release files / openstarlab_phaselearn-0.0.2.tar.gz

Download URL openstarlab_phaselearn-0.0.2.tar.gz
Size 30.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7cc0f07ae5a6572fae89c266971ac4406072ea271809dac1d8797243fff56566
BLAKE2b-256 checksum
How to use checksums
3e4a2941b4e91f3ed6e335f3039287b8daefef6136687c67d10e60c0302a5b29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / openstarlab_phaselearn-0.0.2-py3-none-any.whl

Download URL openstarlab_phaselearn-0.0.2-py3-none-any.whl
Size 40.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a876313e278dc4dcea0214f8766499f07f2428e8e6a147fdfc19059af7e7f196
BLAKE2b-256 checksum
How to use checksums
545caef1340697509562cda63d3e883084b332228e3c8788c4bba9d442a5c949
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for openstarlab-phaselearn 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

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