Scouting and vision tools for YOLO and sports analytics.
Project description
wunderscout
A Python library for extracting player and ball tracking data from soccer match footage using YOLO, Siglip embeddings, and homography.
Features
- Detection & Tracking: Uses YOLO for player/ball/pitch-keypoint detection and ByteTrack for temporal consistency.
- Automated Team Clustering: Groups players into teams using Siglip vision transformer embeddings and K-Means clustering via UMAP dimensionality reduction.
- Pitch Mapping: Transforms 2D image coordinates to a normalized 0-1 coordinate system using pitch keypoint homography.
- Goalkeeper Attribution: Assigns goalkeepers to teams based on proximity to team centroids.
- Data Export: Generates Home and Away CSV files containing frame-by-frame XY coordinates.
Installation
uv add wunderscout
Usage
The ScoutingPipeline class manages calibration, tracking, and data export.
from wunderscout import ScoutingPipeline
# Initialize with paths to trained YOLO weights
pipeline = ScoutingPipeline(
player_weights="players.pt",
field_weights="pitch.pt"
)
# Run processing
pipeline.run(
video_path="input_match.mp4",
output_video_path="ouput_match.mp4"
)
Internal Components
- VisionEngine: Manages YOLO models and generates Siglip embeddings for player crops.
- PitchMapper: Computes homography matrices based on a 32-point pitch configuration. Handles RANSAC-based perspective transforms.
- TeamClassifier: Performs unsupervised clustering on player embeddings. Uses a rolling consensus buffer to stabilize team assignments across frames.
- DataExporter: Formats tracking results into CSV files with frame indices and normalized pitch coordinates.
Dependencies
ultralyticssupervisiontransformersumap-learnscikit-learnopencv-python
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wunderscout-0.1.8.tar.gz.
File metadata
- Download URL: wunderscout-0.1.8.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d59d06a420b83d3b4866348f8b816c581cae08af13d064dc55741824749cf6a
|
|
| MD5 |
f3f1c2c702d2569246450e25ed4903e3
|
|
| BLAKE2b-256 |
351c88f06b50b59466aed6835863f5da601e82dbb6657f6d602b4a38cacf729d
|
Provenance
The following attestation bundles were made for wunderscout-0.1.8.tar.gz:
Publisher:
publish.yml on qhuboo/wunderscout
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wunderscout-0.1.8.tar.gz -
Subject digest:
4d59d06a420b83d3b4866348f8b816c581cae08af13d064dc55741824749cf6a - Sigstore transparency entry: 814196156
- Sigstore integration time:
-
Permalink:
qhuboo/wunderscout@f97efc95481ccb1c69c68cea7c0d7bfd97f62a2a -
Branch / Tag:
refs/tags/v0.1.8 - Owner: https://github.com/qhuboo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f97efc95481ccb1c69c68cea7c0d7bfd97f62a2a -
Trigger Event:
push
-
Statement type:
File details
Details for the file wunderscout-0.1.8-py3-none-any.whl.
File metadata
- Download URL: wunderscout-0.1.8-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
727a878a9afa92d35241357a542e260627ddb992a7be48957a065306a4dfcf11
|
|
| MD5 |
20b795b523896976295f31887111c562
|
|
| BLAKE2b-256 |
5ed1a9db79e89d2709494a184644f4680d8dd31018ef7b147f99dfce6b193536
|
Provenance
The following attestation bundles were made for wunderscout-0.1.8-py3-none-any.whl:
Publisher:
publish.yml on qhuboo/wunderscout
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wunderscout-0.1.8-py3-none-any.whl -
Subject digest:
727a878a9afa92d35241357a542e260627ddb992a7be48957a065306a4dfcf11 - Sigstore transparency entry: 814196158
- Sigstore integration time:
-
Permalink:
qhuboo/wunderscout@f97efc95481ccb1c69c68cea7c0d7bfd97f62a2a -
Branch / Tag:
refs/tags/v0.1.8 - Owner: https://github.com/qhuboo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f97efc95481ccb1c69c68cea7c0d7bfd97f62a2a -
Trigger Event:
push
-
Statement type: