Skip to main content

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

  • ultralytics
  • supervision
  • transformers
  • umap-learn
  • scikit-learn
  • opencv-python

License

MIT

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

wunderscout-0.1.9.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

wunderscout-0.1.9-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file wunderscout-0.1.9.tar.gz.

File metadata

  • Download URL: wunderscout-0.1.9.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wunderscout-0.1.9.tar.gz
Algorithm Hash digest
SHA256 45d87f3d365b3d692a517a247574848a8e7e73b892a79c0b97c7f8589cef0cf0
MD5 59c1eafc757fcb0e7db621db54e61975
BLAKE2b-256 84c5f4c999f2c71816914facdc9975d7ce92aa783ecafc31f6e3928d6e37fc8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for wunderscout-0.1.9.tar.gz:

Publisher: publish.yml on qhuboo/wunderscout

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wunderscout-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: wunderscout-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wunderscout-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 21e676b04f550c4ef3bfa417abab2b215d4607f1ae6df7a0483acce282edb97e
MD5 80f04716b07ce0eb08bfa4f16fbf7246
BLAKE2b-256 1ebf6ac83384a6ca37561d340d0dcf7a1224a37cacfa0a3d7d820d6c14f19638

See more details on using hashes here.

Provenance

The following attestation bundles were made for wunderscout-0.1.9-py3-none-any.whl:

Publisher: publish.yml on qhuboo/wunderscout

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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