Hawkeye¶
The Hawkeye implementation currently only supports 2-dimensional data.
Hawkeye uses a slightly different file structure than most other tracking data providers. Hawkeye provides a single file of ball coordinates (ball_feeds
) and player coordinates player_centroid_feeds
per minute of match time.
Hawkeye files are delivered in the following structure:
scrubbed.samples.ball/*_*_*_1_14.football.samples.ball
scrubbed.samples.centroids/*_*_*_1_14.football.samples.centroids
The "*_*_*"
indicates a date, time and game unique identifier, "1" here refers to the first period and "14" refers to the 14th minute of play.
⚠️ To correctly load and order these files it is recommended to not alter the file names and extensions.
Load local files¶
Hawkeye supports local files in the form of:
- Individual file paths: (e.g
ball_feeds=scrubbed.samples.ball/*_*_*_1_14.football.samples.ball
) - A list of file paths: (e.g.
ball_feeds=[scrubbed.samples.ball/*_*_*_1_14.football.samples.ball, scrubbed.samples.ball/*_*_*_1_15.football.samples.ball]
) - A folder (e.g
ball_feeds=scrubbed.samples.ball/
)
Note: Kloppy will throw an error when it cannot find player and ball feeds for the same period and minute in the provided file paths / folders
from kloppy import hawkeye
dataset = hawkeye.load(
ball_feeds="data/scrubbed.samples.ball/",
player_centroid_feeds="data/scrubbed.samples.centroids/",
meta_data = None,
pitch_width = 68.0,
pitch_length = 105.0,
sample_rate = None,
limit = 10,
coordinates = None,
show_progress = False,
)
Load remote files¶
Kloppy supports remote files through fsspec
FileSystem under the hood. This allows you to work with files in AWS S3, Google Cloud, Azure Blob, HDFS, FTP, and SFTP without extra tools.
For example you can pass:
- Individual s3 file paths: (e.g
ball_feeds=s3://.../hawkeye/scrubbed.samples.ball/*_*_*_1_14.football.samples.ball
) - A list of s3 file paths: (e.g.
ball_feeds=[s3://.../hawkeye/scrubbed.samples.ball/*_*_*_1_14.football.samples.ball, s3://.../hawkeye/scrubbed.samples.ball/*_*_*_1_15.football.samples.ball]
) - A bucket / folder (e.g
ball_feeds=s3://.../hawkeye/scrubbed.samples.ball/
)
Note: Kloppy might throw an the first time to help you identify missing cloud specific dependencies like s3fs
.
from kloppy import hawkeye
dataset = hawkeye.load(
ball_feeds="s3://.../hawkeye/scrubbed.samples.ball/",
player_centroid_feeds="s3://.../hawkeye/scrubbed.samples.centroids/",
meta_data = None,
pitch_width = 68.0,
pitch_length = 105.0,
sample_rate = None,
limit = 10,
coordinates = None,
show_progress = False,
)