Name | swdl JSON |
Version |
1.11.6
JSON |
| download |
home_page | None |
Summary | Soccerwatch Data Library |
upload_time | 2025-01-13 14:49:09 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Soccerwatch Data Library
This is a small tool to access socccerwatch data with a simple python interface
# Requirements
Additional to a python installation you will need ffmpeg to download videos
# Installation
```bash
sudo pip install swdl
```
# Using the Library
For now the Documentation is quite sparse but here is a short overview about the given Functions
## Access Data Service
The DataService is a class that provide access to all of the data
```python
from swdl.swrest import DataService
ds = DataService(username="MyUser",password="mySuperSecretPW")
match_list = ds.get_matches()
# This take a lot of time
for m in match_list:
print(m)
```
## Save credentials
To store your credentials we provide a helper script which stores username and password in plain text under ~/.swdlrc.
After login you do not need to pass any credentials into the DataService constructor
```bash
swdl-login
```
## Download Single Match Info
You can get a specific #Match by passing the match id
```python
match = ds.get_match(1300)
print match
-------------------OUTPUT
Match[ id: 1300,
camera: 51,
name: FC Borussia Droeschede-DJK VfL Billerbeck,
location: Kunstrasenplatz, ESO-Stadion Auf der Emst, Am Suedenberg 36a, 58644 Iserlohn
state: done
video: https://xfiles100.blob.core.windows.net/1300/720p/1300.m3u8
grid: https://xfiles100.blob.core.windows.net/1300/Grid/1300.m3u8]
```
## Update Match Information
To sync the match information with the server you can use the two pull methods. One is for updating the match information and one is for updating the labels.
NOTE: The labels will only be downloaded by pull_labels request:
```python
match.pull_info()
match.pull_labels()
```
## Download Video
There are functions to download the videos of the match. User stream refers to the video after processed by the AI. Grid is a 3x2 Grid video of all 6 cameras.
This functions requieres ffmpeg to be installed on your system
```python
match.download_user_stream()
match.download_grid_stream()
```
## Save Labels
To save labels to disc you will need to get an match, update the labels and call the save function
```python
match = ds.get_match(1300)
match.pull_labels()
match.labels.save("labels.h5")
```
## Load Labels
To load the labels you can call the read function
```python
match = ds.get_match(1300)
label_data = match.labels.from_file()
```
# Data Explaination
The data contains on the one side the video material in form of grid or user stream and on the other side of a labels dataset which is includes information obout camera positions and special events.
## Grid Stream Video
The Grid stream is a 2x3 grid video showing all 6 cameras of the Soccerwatch camerasystems. In the table below you can find the positioning for each camera:
| left-column | right-column |
| ------------ | ------------- |
| top-left | top-mid-right |
| top-mid-left | top-right |
| top-mid | bottom-fishey |
The Grid Stream has a resolution of 3296x3712, ~25 FPS and is H.265 coded.
## User Stream Video
The user stream video is generated by stiching the 6 cameras from the Grid Stream to a panorama and applying the AI to select the scene-of-interest. Typically the User Stream is saved in 720p format (1280x720, ~ 25 FPS, H.264 coded).
## Labels
The label dictionary containes three entries "events", "labels" and "status", which you can access using
```python
events = match.labels.events
labels = match.labels.postions
status = match.labels.status
```
The resulting arries contain following information:
| events[n_events, 3] | description |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| events[:, 0] | position of the event (in seconds) |
| events[:, 1] | event type (0 - goal; 1 - kickoff; 2 - corner; 3 - throw in; 4 - penalty; 5 - foul; 6 - score opportunity; 8 - whistle) |
| events[:, 2] | which team caused the event (0 - home team; 1 - away team) |
| labels[n_labels, 8] | description |
| ------------------- | ------------------------- |
| labels[:, 0] | timepoint in milliseconds |
| labels[:, 1] | target x position |
| labels[:, 2] | target y position |
| labels[:, 3] | target zoom |
| labels[:, 4] | actual x position |
| labels[:, 5] | actual y position |
| labels[:, 6] | actual zoom |
| labels[:, 7] | automatically created |
| status[11,] | timepoint (in milliseconds) where... |
| ----------- | ---------------------------------------------- |
| status[0] | game status changed to before game |
| status[1] | game status changed to first half |
| status[2] | game status changed to half time |
| status[3] | game status changed to second half |
| status[4] | game status changed to after regular game |
| status[5] | game status changed to first half overtime |
| status[6] | game status changed to half time overtime |
| status[7] | game status changed to second half overtime |
| status[8] | game status changed to after overtime |
| status[9] | game status changed to penalty shoot-out |
| status[10] | game status changed to after penalty shoot-out |
Raw data
{
"_id": null,
"home_page": null,
"name": "swdl",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Christian Bodenstein <bodenstein@soccerwatch.tv>",
"download_url": null,
"platform": null,
"description": "# Soccerwatch Data Library\n\nThis is a small tool to access socccerwatch data with a simple python interface\n\n# Requirements\n\nAdditional to a python installation you will need ffmpeg to download videos\n\n# Installation\n\n```bash\nsudo pip install swdl\n```\n\n# Using the Library\n\nFor now the Documentation is quite sparse but here is a short overview about the given Functions\n\n## Access Data Service\n\nThe DataService is a class that provide access to all of the data\n\n```python\nfrom swdl.swrest import DataService\nds = DataService(username=\"MyUser\",password=\"mySuperSecretPW\")\nmatch_list = ds.get_matches()\n# This take a lot of time\nfor m in match_list:\n print(m)\n```\n\n## Save credentials\n\nTo store your credentials we provide a helper script which stores username and password in plain text under ~/.swdlrc.\nAfter login you do not need to pass any credentials into the DataService constructor\n\n```bash\nswdl-login\n```\n\n## Download Single Match Info\n\nYou can get a specific #Match by passing the match id\n\n```python\nmatch = ds.get_match(1300)\nprint match\n-------------------OUTPUT\nMatch[\tid:\t\t1300,\n\tcamera:\t\t51,\n\tname:\t\tFC Borussia Droeschede-DJK VfL Billerbeck,\n\tlocation:\tKunstrasenplatz, ESO-Stadion Auf der Emst, Am Suedenberg 36a, 58644 Iserlohn\n\tstate:\t\tdone\n\tvideo:\t\thttps://xfiles100.blob.core.windows.net/1300/720p/1300.m3u8\n\tgrid:\t\thttps://xfiles100.blob.core.windows.net/1300/Grid/1300.m3u8]\n```\n\n## Update Match Information\n\nTo sync the match information with the server you can use the two pull methods. One is for updating the match information and one is for updating the labels.\nNOTE: The labels will only be downloaded by pull_labels request:\n\n```python\nmatch.pull_info()\nmatch.pull_labels()\n```\n\n## Download Video\n\nThere are functions to download the videos of the match. User stream refers to the video after processed by the AI. Grid is a 3x2 Grid video of all 6 cameras.\nThis functions requieres ffmpeg to be installed on your system\n\n```python\nmatch.download_user_stream()\nmatch.download_grid_stream()\n```\n\n## Save Labels\n\nTo save labels to disc you will need to get an match, update the labels and call the save function\n\n```python\nmatch = ds.get_match(1300)\nmatch.pull_labels()\nmatch.labels.save(\"labels.h5\")\n```\n\n## Load Labels\n\nTo load the labels you can call the read function\n\n```python\nmatch = ds.get_match(1300)\nlabel_data = match.labels.from_file()\n```\n\n# Data Explaination\n\nThe data contains on the one side the video material in form of grid or user stream and on the other side of a labels dataset which is includes information obout camera positions and special events.\n\n## Grid Stream Video\n\nThe Grid stream is a 2x3 grid video showing all 6 cameras of the Soccerwatch camerasystems. In the table below you can find the positioning for each camera:\n\n| left-column | right-column |\n| ------------ | ------------- |\n| top-left | top-mid-right |\n| top-mid-left | top-right |\n| top-mid | bottom-fishey |\n\nThe Grid Stream has a resolution of 3296x3712, ~25 FPS and is H.265 coded.\n\n## User Stream Video\n\nThe user stream video is generated by stiching the 6 cameras from the Grid Stream to a panorama and applying the AI to select the scene-of-interest. Typically the User Stream is saved in 720p format (1280x720, ~ 25 FPS, H.264 coded).\n\n## Labels\n\nThe label dictionary containes three entries \"events\", \"labels\" and \"status\", which you can access using\n\n```python\nevents = match.labels.events\nlabels = match.labels.postions\nstatus = match.labels.status\n```\n\nThe resulting arries contain following information:\n\n| events[n_events, 3] | description |\n| ------------------- | ----------------------------------------------------------------------------------------------------------------------- |\n| events[:, 0] | position of the event (in seconds) |\n| events[:, 1] | event type (0 - goal; 1 - kickoff; 2 - corner; 3 - throw in; 4 - penalty; 5 - foul; 6 - score opportunity; 8 - whistle) |\n| events[:, 2] | which team caused the event (0 - home team; 1 - away team) |\n\n| labels[n_labels, 8] | description |\n| ------------------- | ------------------------- |\n| labels[:, 0] | timepoint in milliseconds |\n| labels[:, 1] | target x position |\n| labels[:, 2] | target y position |\n| labels[:, 3] | target zoom |\n| labels[:, 4] | actual x position |\n| labels[:, 5] | actual y position |\n| labels[:, 6] | actual zoom |\n| labels[:, 7] | automatically created |\n\n| status[11,] | timepoint (in milliseconds) where... |\n| ----------- | ---------------------------------------------- |\n| status[0] | game status changed to before game |\n| status[1] | game status changed to first half |\n| status[2] | game status changed to half time |\n| status[3] | game status changed to second half |\n| status[4] | game status changed to after regular game |\n| status[5] | game status changed to first half overtime |\n| status[6] | game status changed to half time overtime |\n| status[7] | game status changed to second half overtime |\n| status[8] | game status changed to after overtime |\n| status[9] | game status changed to penalty shoot-out |\n| status[10] | game status changed to after penalty shoot-out |\n",
"bugtrack_url": null,
"license": null,
"summary": "Soccerwatch Data Library",
"version": "1.11.6",
"project_urls": {
"Homepage": "https://bitbucket.org/soccerwatch/swdl/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "12cb1e4b044acdc5eeec79c72ff9836bd4cb4835436fe8dbc802f3a868a4987f",
"md5": "0b06586f51b5ed569b3eefeac25f1ad1",
"sha256": "d3ed405247d9212db9e7d84d2f09fdb154c53fc46f21e5e499973f8cbdbd0f31"
},
"downloads": -1,
"filename": "swdl-1.11.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0b06586f51b5ed569b3eefeac25f1ad1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 29578,
"upload_time": "2025-01-13T14:49:09",
"upload_time_iso_8601": "2025-01-13T14:49:09.780796Z",
"url": "https://files.pythonhosted.org/packages/12/cb/1e4b044acdc5eeec79c72ff9836bd4cb4835436fe8dbc802f3a868a4987f/swdl-1.11.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-13 14:49:09",
"github": false,
"gitlab": false,
"bitbucket": true,
"codeberg": false,
"bitbucket_user": "soccerwatch",
"bitbucket_project": "swdl",
"lcname": "swdl"
}