Skip to main content

openstarlab phaselearn modeling package

Project description

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

🧑‍💻

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openstarlab_phaselearn-0.0.2.tar.gz (30.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openstarlab_phaselearn-0.0.2-py3-none-any.whl (40.2 kB view details)

Uploaded Python 3

File details

Details for the file openstarlab_phaselearn-0.0.2.tar.gz.

File metadata

  • Download URL: openstarlab_phaselearn-0.0.2.tar.gz
  • Upload date:
  • Size: 30.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for openstarlab_phaselearn-0.0.2.tar.gz
Algorithm Hash digest
SHA256 7cc0f07ae5a6572fae89c266971ac4406072ea271809dac1d8797243fff56566
MD5 4bd97ee87e1b79d839dd4f0494acd824
BLAKE2b-256 3e4a2941b4e91f3ed6e335f3039287b8daefef6136687c67d10e60c0302a5b29

See more details on using hashes here.

File details

Details for the file openstarlab_phaselearn-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for openstarlab_phaselearn-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a876313e278dc4dcea0214f8766499f07f2428e8e6a147fdfc19059af7e7f196
MD5 479af812c2086b6cd21e4dd59f68a2b5
BLAKE2b-256 545caef1340697509562cda63d3e883084b332228e3c8788c4bba9d442a5c949

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page