opensportslib 0.1.3.dev1__tar.gz → 0.1.3.dev3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. {opensportslib-0.1.3.dev1/opensportslib.egg-info → opensportslib-0.1.3.dev3}/PKG-INFO +91 -7
  2. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/README.md +90 -6
  3. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/examples/quickstart/basic_classification.py +1 -1
  4. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/examples/quickstart/basic_localization.py +1 -1
  5. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3/opensportslib.egg-info}/PKG-INFO +91 -7
  6. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/pyproject.toml +1 -1
  7. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/tools/training/classification.py +3 -3
  8. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/tools/training/localization.py +3 -3
  9. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/LICENSE +0 -0
  10. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/LICENSE-COMMERCIAL +0 -0
  11. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/MANIFEST.in +0 -0
  12. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/__init__.py +0 -0
  13. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/apis/__init__.py +0 -0
  14. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/apis/base_task_model.py +0 -0
  15. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/apis/classification.py +0 -0
  16. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/apis/localization.py +0 -0
  17. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/cli.py +0 -0
  18. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/config/classification.yaml +0 -0
  19. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/config/localization-e2e-ocv.yaml +0 -0
  20. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/config/localization-json_calf_resnetpca512.yaml +0 -0
  21. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/config/localization-json_netvlad++_resnetpca512.yaml +0 -0
  22. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/config/localization.yaml +0 -0
  23. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/config/sngar-frames.yaml +0 -0
  24. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/config/sngar-tracking.yaml +0 -0
  25. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/__init__.py +0 -0
  26. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/loss/__init__.py +0 -0
  27. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/loss/builder.py +0 -0
  28. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/loss/calf.py +0 -0
  29. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/loss/ce.py +0 -0
  30. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/loss/combine.py +0 -0
  31. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/loss/nll.py +0 -0
  32. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/optimizer/__init__.py +0 -0
  33. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/optimizer/builder.py +0 -0
  34. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/sampler/weighted_sampler.py +0 -0
  35. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/scheduler/__init__.py +0 -0
  36. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/scheduler/builder.py +0 -0
  37. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/trainer/__init__.py +0 -0
  38. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/trainer/classification_trainer.py +0 -0
  39. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/trainer/localization_trainer.py +0 -0
  40. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/utils/checkpoint.py +0 -0
  41. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/utils/config.py +0 -0
  42. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/utils/data.py +0 -0
  43. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/utils/ddp.py +0 -0
  44. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/utils/default_args.py +0 -0
  45. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/utils/lightning.py +0 -0
  46. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/utils/load_annotations.py +0 -0
  47. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/utils/seed.py +0 -0
  48. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/utils/video_processing.py +0 -0
  49. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/core/utils/wandb.py +0 -0
  50. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/datasets/__init__.py +0 -0
  51. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/datasets/builder.py +0 -0
  52. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/datasets/classification_dataset.py +0 -0
  53. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/datasets/localization_dataset.py +0 -0
  54. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/datasets/utils/__init__.py +0 -0
  55. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/datasets/utils/tracking.py +0 -0
  56. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/metrics/classification_metric.py +0 -0
  57. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/metrics/localization_metric.py +0 -0
  58. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/__init__.py +0 -0
  59. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/backbones/builder.py +0 -0
  60. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/base/contextaware.py +0 -0
  61. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/base/e2e.py +0 -0
  62. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/base/learnablepooling.py +0 -0
  63. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/base/tracking.py +0 -0
  64. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/base/vars.py +0 -0
  65. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/base/video.py +0 -0
  66. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/base/video_mae.py +0 -0
  67. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/builder.py +0 -0
  68. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/heads/builder.py +0 -0
  69. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/neck/builder.py +0 -0
  70. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/utils/common.py +0 -0
  71. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/utils/impl/__init__.py +0 -0
  72. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/utils/impl/asformer.py +0 -0
  73. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/utils/impl/calf.py +0 -0
  74. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/utils/impl/gsm.py +0 -0
  75. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/utils/impl/gtad.py +0 -0
  76. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/utils/impl/tsm.py +0 -0
  77. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/utils/litebase.py +0 -0
  78. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/utils/modules.py +0 -0
  79. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/utils/shift.py +0 -0
  80. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/models/utils/utils.py +0 -0
  81. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/setup/setup.py +0 -0
  82. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/tools/__init__.py +0 -0
  83. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/tools/_common.py +0 -0
  84. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/tools/hf_transfer.py +0 -0
  85. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/tools/osl_json_to_parquet.py +0 -0
  86. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib/tools/parquet_to_osl_json.py +0 -0
  87. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib.egg-info/SOURCES.txt +0 -0
  88. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib.egg-info/dependency_links.txt +0 -0
  89. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib.egg-info/entry_points.txt +0 -0
  90. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib.egg-info/requires.txt +0 -0
  91. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/opensportslib.egg-info/top_level.txt +0 -0
  92. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/setup.cfg +0 -0
  93. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/tests/conftest.py +0 -0
  94. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/tests/test_classification_dataset_paths.py +0 -0
  95. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/tests/test_classification_trainer_dataloader.py +0 -0
  96. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/tests/test_config_utils_smoke.py +0 -0
  97. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/tests/test_conversion_tools.py +0 -0
  98. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/tests/test_hf_transfer_tools.py +0 -0
  99. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/tests/test_localization_dali_filenames.py +0 -0
  100. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/tests/test_package_smoke.py +0 -0
  101. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/tests/test_public_apis_smoke.py +0 -0
  102. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/tests/test_subset_train_infer_integration.py +0 -0
  103. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/tests/test_task_model_api_contract.py +0 -0
  104. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/tools/convert/build_soccernet_gar.py +0 -0
  105. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/tools/convert/build_soccernet_gar_action_spotting.py +0 -0
  106. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/tools/convert/osl_json_to_parquet_webdataset.py +0 -0
  107. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/tools/convert/parquet_webdataset_to_osl_json.py +0 -0
  108. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/tools/download/download_hf_repo.py +0 -0
  109. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/tools/download/download_osl_hf.py +0 -0
  110. {opensportslib-0.1.3.dev1 → opensportslib-0.1.3.dev3}/tools/download/upload_osl_hf.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: opensportslib
3
- Version: 0.1.3.dev1
3
+ Version: 0.1.3.dev3
4
4
  Summary: OpenSportsLib is the professional library, designed for advanced video understanding in sports. It provides state-of-the-art tools for action recognition, spotting, retrieval, and captioning, making it ideal for researchers, analysts, and developers working with sports video data.
5
5
  Author: Jeet Vora
6
6
  Requires-Python: >=3.12
@@ -57,6 +57,7 @@ OpenSportsLib is designed for **researchers, ML engineers, and sports analytics
57
57
  ## Quick links
58
58
 
59
59
  - **Documentation:** https://opensportslab.github.io/opensportslib/
60
+ - **OSL JSON format:** https://opensportslab.github.io/opensportslib/data/osl-json-format/
60
61
  - **PyPI:** https://pypi.org/project/opensportslib/
61
62
  - **Issues:** https://github.com/OpenSportsLab/opensportslib/issues
62
63
 
@@ -113,7 +114,85 @@ Use it as the main entry point to find:
113
114
  - extracted features
114
115
  - pretrained models and checkpoints
115
116
 
116
- --
117
+ See the [Model Zoo](docs/model-zoo.md) for available pretrained models,
118
+ reported scores, datasets, and loading snippets.
119
+
120
+ ---
121
+
122
+ ## Dataset format
123
+
124
+ OpenSportsLib annotation files use the **OSL JSON v2.0** format. A dataset JSON
125
+ contains top-level metadata, a shared `labels` schema, and a `data` array where
126
+ each sample points to one or more inputs.
127
+
128
+ Minimal classification sample:
129
+
130
+ ```json
131
+ {
132
+ "labels": {
133
+ "action": {
134
+ "type": "single_label",
135
+ "labels": ["pass", "shot"]
136
+ }
137
+ },
138
+ "data": [
139
+ {
140
+ "id": "clip_0001",
141
+ "inputs": [
142
+ {
143
+ "type": "video",
144
+ "path": "clips/clip_0001.mp4",
145
+ "fps": 25.0
146
+ }
147
+ ],
148
+ "labels": {
149
+ "action": {
150
+ "label": "shot"
151
+ }
152
+ }
153
+ }
154
+ ]
155
+ }
156
+ ```
157
+
158
+ Minimal localization sample:
159
+
160
+ ```json
161
+ {
162
+ "labels": {
163
+ "action": {
164
+ "type": "single_label",
165
+ "labels": ["pass", "shot"]
166
+ }
167
+ },
168
+ "data": [
169
+ {
170
+ "id": "game_0001",
171
+ "inputs": [
172
+ {
173
+ "type": "video",
174
+ "path": "games/game_0001.mp4",
175
+ "fps": 25.0
176
+ }
177
+ ],
178
+ "events": [
179
+ {
180
+ "head": "action",
181
+ "label": "pass",
182
+ "position_ms": 1240
183
+ }
184
+ ]
185
+ }
186
+ ]
187
+ }
188
+ ```
189
+
190
+ Relative paths in `inputs[].path` are resolved from the split media root in the
191
+ YAML config, for example `DATA.train.video_path`. See the full
192
+ [OSL JSON format guide](docs/data/osl-json-format.md) for field definitions,
193
+ multi-modal examples, prediction payloads, and conversion notes.
194
+
195
+ ---
117
196
 
118
197
  ## Quickstart
119
198
 
@@ -131,7 +210,7 @@ from opensportslib.apis import ClassificationModel
131
210
 
132
211
  my_model = ClassificationModel(
133
212
  config="/path/to/classification.yaml",
134
- weights="/path/to/weights.pt", # optional
213
+ weights=None, # optional: path or Hugging Face model ID
135
214
  )
136
215
 
137
216
  my_model.train(
@@ -147,7 +226,7 @@ from opensportslib.apis import ClassificationModel
147
226
 
148
227
  my_model = ClassificationModel(
149
228
  config="/path/to/classification.yaml",
150
- weights="/path/to/weights.pt", # optional
229
+ weights=None, # optional: path or Hugging Face model ID
151
230
  )
152
231
 
153
232
  predictions = my_model.infer(
@@ -178,7 +257,7 @@ from opensportslib.apis import LocalizationModel
178
257
 
179
258
  my_model = LocalizationModel(
180
259
  config="/path/to/localization.yaml",
181
- weights="/path/to/weights.pt", # optional
260
+ weights=None, # optional: path or Hugging Face model ID
182
261
  )
183
262
 
184
263
  predictions = my_model.infer(
@@ -220,8 +299,8 @@ from opensportslib.tools import (
220
299
  ### Scripts
221
300
 
222
301
  ```bash
223
- python tools/download_osl_hf.py --repo-id <org/repo> --revision main --split test --format parquet --output-dir downloaded_data
224
- python tools/upload_osl_hf.py --repo-id <org/repo> --json-path <local_dataset.json> --split test --revision main
302
+ python tools/download/download_osl_hf.py --repo-id <org/repo> --revision main --split test --format parquet --output-dir downloaded_data
303
+ python tools/download/upload_osl_hf.py --repo-id <org/repo> --json-path <local_dataset.json> --split test --revision main
225
304
  ```
226
305
 
227
306
  Downloads are placed under `<output-dir>/<revision>/<split>`.
@@ -238,9 +317,13 @@ Predict when key events happen in long untrimmed sports videos.
238
317
 
239
318
  ### Action Retrieval
240
319
  Search and retrieve relevant clips or moments from a collection of sports videos.
320
+ This is part of the roadmap and OSL data model, not a first-class OpenSportsLib
321
+ training workflow yet.
241
322
 
242
323
  ### Action Description / Captioning
243
324
  Generate text descriptions for sports events and temporal segments.
325
+ This is part of the roadmap and OSL data model, not a first-class OpenSportsLib
326
+ training workflow yet.
244
327
 
245
328
  ---
246
329
 
@@ -260,6 +343,7 @@ Generate text descriptions for sports events and temporal segments.
260
343
  Use the README for the fast start, then go deeper through:
261
344
 
262
345
  - Full documentation: https://opensportslab.github.io/opensportslib/
346
+ - OSL JSON format: [docs/data/osl-json-format.md](docs/data/osl-json-format.md)
263
347
  - High-level API guide: [opensportslib/apis/README.md](opensportslib/apis/README.md)
264
348
  - Configuration guide: https://opensportslab.github.io/opensportslib/tni/config-guide/
265
349
  - Example configs: [examples/configs/](examples/configs/)
@@ -22,6 +22,7 @@ OpenSportsLib is designed for **researchers, ML engineers, and sports analytics
22
22
  ## Quick links
23
23
 
24
24
  - **Documentation:** https://opensportslab.github.io/opensportslib/
25
+ - **OSL JSON format:** https://opensportslab.github.io/opensportslib/data/osl-json-format/
25
26
  - **PyPI:** https://pypi.org/project/opensportslib/
26
27
  - **Issues:** https://github.com/OpenSportsLab/opensportslib/issues
27
28
 
@@ -78,7 +79,85 @@ Use it as the main entry point to find:
78
79
  - extracted features
79
80
  - pretrained models and checkpoints
80
81
 
81
- --
82
+ See the [Model Zoo](docs/model-zoo.md) for available pretrained models,
83
+ reported scores, datasets, and loading snippets.
84
+
85
+ ---
86
+
87
+ ## Dataset format
88
+
89
+ OpenSportsLib annotation files use the **OSL JSON v2.0** format. A dataset JSON
90
+ contains top-level metadata, a shared `labels` schema, and a `data` array where
91
+ each sample points to one or more inputs.
92
+
93
+ Minimal classification sample:
94
+
95
+ ```json
96
+ {
97
+ "labels": {
98
+ "action": {
99
+ "type": "single_label",
100
+ "labels": ["pass", "shot"]
101
+ }
102
+ },
103
+ "data": [
104
+ {
105
+ "id": "clip_0001",
106
+ "inputs": [
107
+ {
108
+ "type": "video",
109
+ "path": "clips/clip_0001.mp4",
110
+ "fps": 25.0
111
+ }
112
+ ],
113
+ "labels": {
114
+ "action": {
115
+ "label": "shot"
116
+ }
117
+ }
118
+ }
119
+ ]
120
+ }
121
+ ```
122
+
123
+ Minimal localization sample:
124
+
125
+ ```json
126
+ {
127
+ "labels": {
128
+ "action": {
129
+ "type": "single_label",
130
+ "labels": ["pass", "shot"]
131
+ }
132
+ },
133
+ "data": [
134
+ {
135
+ "id": "game_0001",
136
+ "inputs": [
137
+ {
138
+ "type": "video",
139
+ "path": "games/game_0001.mp4",
140
+ "fps": 25.0
141
+ }
142
+ ],
143
+ "events": [
144
+ {
145
+ "head": "action",
146
+ "label": "pass",
147
+ "position_ms": 1240
148
+ }
149
+ ]
150
+ }
151
+ ]
152
+ }
153
+ ```
154
+
155
+ Relative paths in `inputs[].path` are resolved from the split media root in the
156
+ YAML config, for example `DATA.train.video_path`. See the full
157
+ [OSL JSON format guide](docs/data/osl-json-format.md) for field definitions,
158
+ multi-modal examples, prediction payloads, and conversion notes.
159
+
160
+ ---
82
161
 
83
162
  ## Quickstart
84
163
 
@@ -96,7 +175,7 @@ from opensportslib.apis import ClassificationModel
96
175
 
97
176
  my_model = ClassificationModel(
98
177
  config="/path/to/classification.yaml",
99
- weights="/path/to/weights.pt", # optional
178
+ weights=None, # optional: path or Hugging Face model ID
100
179
  )
101
180
 
102
181
  my_model.train(
@@ -112,7 +191,7 @@ from opensportslib.apis import ClassificationModel
112
191
 
113
192
  my_model = ClassificationModel(
114
193
  config="/path/to/classification.yaml",
115
- weights="/path/to/weights.pt", # optional
194
+ weights=None, # optional: path or Hugging Face model ID
116
195
  )
117
196
 
118
197
  predictions = my_model.infer(
@@ -143,7 +222,7 @@ from opensportslib.apis import LocalizationModel
143
222
 
144
223
  my_model = LocalizationModel(
145
224
  config="/path/to/localization.yaml",
146
- weights="/path/to/weights.pt", # optional
225
+ weights=None, # optional: path or Hugging Face model ID
147
226
  )
148
227
 
149
228
  predictions = my_model.infer(
@@ -185,8 +264,8 @@ from opensportslib.tools import (
185
264
  ### Scripts
186
265
 
187
266
  ```bash
188
- python tools/download_osl_hf.py --repo-id <org/repo> --revision main --split test --format parquet --output-dir downloaded_data
189
- python tools/upload_osl_hf.py --repo-id <org/repo> --json-path <local_dataset.json> --split test --revision main
267
+ python tools/download/download_osl_hf.py --repo-id <org/repo> --revision main --split test --format parquet --output-dir downloaded_data
268
+ python tools/download/upload_osl_hf.py --repo-id <org/repo> --json-path <local_dataset.json> --split test --revision main
190
269
  ```
191
270
 
192
271
  Downloads are placed under `<output-dir>/<revision>/<split>`.
@@ -203,9 +282,13 @@ Predict when key events happen in long untrimmed sports videos.
203
282
 
204
283
  ### Action Retrieval
205
284
  Search and retrieve relevant clips or moments from a collection of sports videos.
285
+ This is part of the roadmap and OSL data model, not a first-class OpenSportsLib
286
+ training workflow yet.
206
287
 
207
288
  ### Action Description / Captioning
208
289
  Generate text descriptions for sports events and temporal segments.
290
+ This is part of the roadmap and OSL data model, not a first-class OpenSportsLib
291
+ training workflow yet.
209
292
 
210
293
  ---
211
294
 
@@ -225,6 +308,7 @@ Generate text descriptions for sports events and temporal segments.
225
308
  Use the README for the fast start, then go deeper through:
226
309
 
227
310
  - Full documentation: https://opensportslab.github.io/opensportslib/
311
+ - OSL JSON format: [docs/data/osl-json-format.md](docs/data/osl-json-format.md)
228
312
  - High-level API guide: [opensportslib/apis/README.md](opensportslib/apis/README.md)
229
313
  - Configuration guide: https://opensportslab.github.io/opensportslib/tni/config-guide/
230
314
  - Example configs: [examples/configs/](examples/configs/)
@@ -9,7 +9,7 @@ def main():
9
9
 
10
10
  my_model = ClassificationModel(
11
11
  config="examples/configs/classification_video.yaml",
12
- weights="/path/to/weights.pt", # optional
12
+ weights=None, # optional: path or Hugging Face model ID
13
13
  )
14
14
 
15
15
  my_model.train(
@@ -9,7 +9,7 @@ def main():
9
9
 
10
10
  my_model = LocalizationModel(
11
11
  config="examples/configs/localization.yaml",
12
- weights="/path/to/weights.pt", # optional
12
+ weights=None, # optional: path or Hugging Face model ID
13
13
  )
14
14
 
15
15
  my_model.train(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: opensportslib
3
- Version: 0.1.3.dev1
3
+ Version: 0.1.3.dev3
4
4
  Summary: OpenSportsLib is the professional library, designed for advanced video understanding in sports. It provides state-of-the-art tools for action recognition, spotting, retrieval, and captioning, making it ideal for researchers, analysts, and developers working with sports video data.
5
5
  Author: Jeet Vora
6
6
  Requires-Python: >=3.12
@@ -57,6 +57,7 @@ OpenSportsLib is designed for **researchers, ML engineers, and sports analytics
57
57
  ## Quick links
58
58
 
59
59
  - **Documentation:** https://opensportslab.github.io/opensportslib/
60
+ - **OSL JSON format:** https://opensportslab.github.io/opensportslib/data/osl-json-format/
60
61
  - **PyPI:** https://pypi.org/project/opensportslib/
61
62
  - **Issues:** https://github.com/OpenSportsLab/opensportslib/issues
62
63
 
@@ -113,7 +114,85 @@ Use it as the main entry point to find:
113
114
  - extracted features
114
115
  - pretrained models and checkpoints
115
116
 
116
- --
117
+ See the [Model Zoo](docs/model-zoo.md) for available pretrained models,
118
+ reported scores, datasets, and loading snippets.
119
+
120
+ ---
121
+
122
+ ## Dataset format
123
+
124
+ OpenSportsLib annotation files use the **OSL JSON v2.0** format. A dataset JSON
125
+ contains top-level metadata, a shared `labels` schema, and a `data` array where
126
+ each sample points to one or more inputs.
127
+
128
+ Minimal classification sample:
129
+
130
+ ```json
131
+ {
132
+ "labels": {
133
+ "action": {
134
+ "type": "single_label",
135
+ "labels": ["pass", "shot"]
136
+ }
137
+ },
138
+ "data": [
139
+ {
140
+ "id": "clip_0001",
141
+ "inputs": [
142
+ {
143
+ "type": "video",
144
+ "path": "clips/clip_0001.mp4",
145
+ "fps": 25.0
146
+ }
147
+ ],
148
+ "labels": {
149
+ "action": {
150
+ "label": "shot"
151
+ }
152
+ }
153
+ }
154
+ ]
155
+ }
156
+ ```
157
+
158
+ Minimal localization sample:
159
+
160
+ ```json
161
+ {
162
+ "labels": {
163
+ "action": {
164
+ "type": "single_label",
165
+ "labels": ["pass", "shot"]
166
+ }
167
+ },
168
+ "data": [
169
+ {
170
+ "id": "game_0001",
171
+ "inputs": [
172
+ {
173
+ "type": "video",
174
+ "path": "games/game_0001.mp4",
175
+ "fps": 25.0
176
+ }
177
+ ],
178
+ "events": [
179
+ {
180
+ "head": "action",
181
+ "label": "pass",
182
+ "position_ms": 1240
183
+ }
184
+ ]
185
+ }
186
+ ]
187
+ }
188
+ ```
189
+
190
+ Relative paths in `inputs[].path` are resolved from the split media root in the
191
+ YAML config, for example `DATA.train.video_path`. See the full
192
+ [OSL JSON format guide](docs/data/osl-json-format.md) for field definitions,
193
+ multi-modal examples, prediction payloads, and conversion notes.
194
+
195
+ ---
117
196
 
118
197
  ## Quickstart
119
198
 
@@ -131,7 +210,7 @@ from opensportslib.apis import ClassificationModel
131
210
 
132
211
  my_model = ClassificationModel(
133
212
  config="/path/to/classification.yaml",
134
- weights="/path/to/weights.pt", # optional
213
+ weights=None, # optional: path or Hugging Face model ID
135
214
  )
136
215
 
137
216
  my_model.train(
@@ -147,7 +226,7 @@ from opensportslib.apis import ClassificationModel
147
226
 
148
227
  my_model = ClassificationModel(
149
228
  config="/path/to/classification.yaml",
150
- weights="/path/to/weights.pt", # optional
229
+ weights=None, # optional: path or Hugging Face model ID
151
230
  )
152
231
 
153
232
  predictions = my_model.infer(
@@ -178,7 +257,7 @@ from opensportslib.apis import LocalizationModel
178
257
 
179
258
  my_model = LocalizationModel(
180
259
  config="/path/to/localization.yaml",
181
- weights="/path/to/weights.pt", # optional
260
+ weights=None, # optional: path or Hugging Face model ID
182
261
  )
183
262
 
184
263
  predictions = my_model.infer(
@@ -220,8 +299,8 @@ from opensportslib.tools import (
220
299
  ### Scripts
221
300
 
222
301
  ```bash
223
- python tools/download_osl_hf.py --repo-id <org/repo> --revision main --split test --format parquet --output-dir downloaded_data
224
- python tools/upload_osl_hf.py --repo-id <org/repo> --json-path <local_dataset.json> --split test --revision main
302
+ python tools/download/download_osl_hf.py --repo-id <org/repo> --revision main --split test --format parquet --output-dir downloaded_data
303
+ python tools/download/upload_osl_hf.py --repo-id <org/repo> --json-path <local_dataset.json> --split test --revision main
225
304
  ```
226
305
 
227
306
  Downloads are placed under `<output-dir>/<revision>/<split>`.
@@ -238,9 +317,13 @@ Predict when key events happen in long untrimmed sports videos.
238
317
 
239
318
  ### Action Retrieval
240
319
  Search and retrieve relevant clips or moments from a collection of sports videos.
320
+ This is part of the roadmap and OSL data model, not a first-class OpenSportsLib
321
+ training workflow yet.
241
322
 
242
323
  ### Action Description / Captioning
243
324
  Generate text descriptions for sports events and temporal segments.
325
+ This is part of the roadmap and OSL data model, not a first-class OpenSportsLib
326
+ training workflow yet.
244
327
 
245
328
  ---
246
329
 
@@ -260,6 +343,7 @@ Generate text descriptions for sports events and temporal segments.
260
343
  Use the README for the fast start, then go deeper through:
261
344
 
262
345
  - Full documentation: https://opensportslab.github.io/opensportslib/
346
+ - OSL JSON format: [docs/data/osl-json-format.md](docs/data/osl-json-format.md)
263
347
  - High-level API guide: [opensportslib/apis/README.md](opensportslib/apis/README.md)
264
348
  - Configuration guide: https://opensportslab.github.io/opensportslib/tni/config-guide/
265
349
  - Example configs: [examples/configs/](examples/configs/)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "opensportslib"
7
- version = "0.1.3.dev1"
7
+ version = "0.1.3.dev3"
8
8
  description = "OpenSportsLib is the professional library, designed for advanced video understanding in sports. It provides state-of-the-art tools for action recognition, spotting, retrieval, and captioning, making it ideal for researchers, analysts, and developers working with sports video data."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -7,9 +7,9 @@ def parse_args():
7
7
  parser = argparse.ArgumentParser(description="Minimal classification training script.")
8
8
  parser.add_argument("--config", required=True, help="Path to the YAML config file.")
9
9
  parser.add_argument("--weights", default=None, help="Path to pretrained weights (optional).")
10
- parser.add_argument("--train-set", required=True, help="Path to train annotations JSON.")
11
- parser.add_argument("--valid-set", required=True, help="Path to validation annotations JSON.")
12
- parser.add_argument("--test-set", required=True, help="Path to test annotations JSON.")
10
+ parser.add_argument("--train-set", default=None, help="Path to train annotations JSON. Defaults to DATA.train.path from the config.")
11
+ parser.add_argument("--valid-set", default=None, help="Path to validation annotations JSON. Defaults to DATA.valid.path from the config.")
12
+ parser.add_argument("--test-set", default=None, help="Path to test annotations JSON. Defaults to DATA.test.path from the config.")
13
13
  return parser.parse_args()
14
14
 
15
15
 
@@ -7,9 +7,9 @@ def parse_args():
7
7
  parser = argparse.ArgumentParser(description="Minimal localization training script.")
8
8
  parser.add_argument("--config", required=True, help="Path to the YAML config file.")
9
9
  parser.add_argument("--weights", default=None, help="Path to pretrained weights (optional).")
10
- parser.add_argument("--train-set", required=True, help="Path to train annotations JSON.")
11
- parser.add_argument("--valid-set", required=True, help="Path to validation annotations JSON.")
12
- parser.add_argument("--test-set", required=True, help="Path to test annotations JSON.")
10
+ parser.add_argument("--train-set", default=None, help="Path to train annotations JSON. Defaults to DATA.train.path from the config.")
11
+ parser.add_argument("--valid-set", default=None, help="Path to validation annotations JSON. Defaults to DATA.valid.path from the config.")
12
+ parser.add_argument("--test-set", default=None, help="Path to test annotations JSON. Defaults to DATA.test.path from the config.")
13
13
  return parser.parse_args()
14
14
 
15
15