Metadata-Version: 2.4
Name: opensportslib
Version: 0.3.4.dev2
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.
Author: Jeet Vora
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: LICENSE-COMMERCIAL
Requires-Dist: SoccerNet
Requires-Dist: av
Requires-Dist: decord; platform_system != "Darwin" and platform_machine != "arm64" and platform_machine != "aarch64"
Requires-Dist: evaluate
Requires-Dist: scikit-learn
Requires-Dist: torch
Requires-Dist: torchvision
Requires-Dist: transformers==4.57.3
Requires-Dist: tokenizers==0.22.1
Requires-Dist: accelerate
Requires-Dist: wandb
Requires-Dist: opencv-python
Requires-Dist: omegaconf
Requires-Dist: timm
Requires-Dist: seaborn
Requires-Dist: tabulate
Requires-Dist: pytorch-lightning
Requires-Dist: pandas
Requires-Dist: pyarrow
Requires-Dist: h5py==3.16.0
Requires-Dist: huggingface_hub
Requires-Dist: datasets<6,>=5.0.0
Requires-Dist: easydict
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-json-report; extra == "test"
Requires-Dist: pytest-timeout; extra == "test"
Provides-Extra: reproduction
Requires-Dist: yt-dlp[default]; extra == "reproduction"
Requires-Dist: deno>=2.3; extra == "reproduction"
Dynamic: license-file

# OpenSportsLib

**Sports AI experiments, from data to released models.**

OpenSportsLib brings classification, action localization/spotting and visual
question answering into one configurable Python framework. Train, evaluate and
run inference with task APIs; exchange datasets and predictions through OSL JSON.

[Documentation](https://opensportslab.github.io/opensportslib/) ·
[Datasets](docs/datasets/index.md) · [Methods](docs/methods/index.md) ·
[Released models](docs/model-zoo.md) · [Reproductions](docs/reproductions/index.md)

## Get started

Requires Python 3.12+. In your environment:

```bash
pip install opensportslib
opensportslib setup
```

For source development, use `pip install -e .` from this checkout. Optional
PyTorch Geometric, DALI and VQA profiles are described in the
[installation guide](docs/getting-started/installation.md).

Load a public Tennis swing checkpoint and supply your own video:

```python
from opensportslib.apis import LocalizationModel

model = LocalizationModel.from_pretrained(
    "OpenSportsLab/OSL-loc-tennis-public",
    revision="a00b8454db0fd6b1f0d039274de8ecb541833b9b",
    device="cpu",
)
predictions = model.infer(video_path="clip.mp4", use_wandb=False)
model.save_predictions("predictions.json", predictions)
```

This earlier Tennis model has its own labels and protocol; it is distinct from
the six-class precise event spotting benchmark. Choose a matching dataset,
input representation and experiment revision in the model catalog. Some releases
require authorized access.

## Explore the library

| Goal | Start here |
|---|---|
| Train, infer and evaluate | [First workflow](docs/getting-started/first-workflow.md) · [Task API](opensportslib/apis/README.md) |
| Choose data | [Dataset catalog](docs/datasets/index.md): sources, labels, pinned revisions and download examples |
| Compare algorithms | [Method catalog](docs/methods/index.md): papers, main studies and ablations |
| Use released artifacts | [Model catalog](docs/model-zoo.md): weights, matching configs and experiment versions |
| Inspect predictions/results | Dataset leaderboards link measured scores and **Predictions (OSL JSON)** |
| Reproduce a study | [Research guides](docs/reproductions/index.md) · [One-command Ibex campaigns](docs/reproducibility/ibex/training.md) |
| Extend a task or method | [Architecture](DEVELOPERS.md) · [Extension guide](docs/developer/extensions.md) |
| Serve a model | [Inference server](server/README.md) |

## Released research experiments

The localization catalog includes completed T-DEED, NetVLAD/NetRVLAD and
NetVLAD++/NetRVLAD++ experiments. Historical T-DEED FineDiving releases remain
separate; the model catalog shows release counts for each method. Weights, configs and available
predictions use immutable Hugging Face links; structured histories preserve the
original first-epoch values. [Browse the evidence index](reproduction/releases/README.md).

E2E-Spot paper recipes and ablations are registered. Ongoing experiments enter
the catalog after evaluation and publication, without blocking other development.
Existing Tennis, BAS and header artifacts keep their original scopes. Paper and
library results are compared only when their evaluation protocols match.

## Reproduce and extend

```bash
python tools/slurm/queue_experiments.py --campaign reproduction/localization.yaml --dry-run
python tools/slurm/queue_experiments.py --campaign reproduction/localization.yaml
```

The campaign declares methods, data, seeds and resource profiles. An ignored
local profile supplies cluster paths and environment settings. The launcher
prepares and verifies data, freezes source for running jobs, stages inputs on
node-local storage and records each attempt. Model publication is configurable;
future results are staged outside the development checkout for review.

Existing complete baselines select exact one-epoch regression checks from the
original initialization. First-epoch equality is useful evidence of regression
stability; it does not establish identical complete training or paper reproduction.
[Workflow and extension contract](docs/reproducibility/ibex/training.md).

## Contributing

We welcome contributions. Pull requests must target `dev`, and each
GitHub-linked commit author must accept the [Individual Contributor License
Agreement](.github/CLA.md) when prompted by the `CLA check`.

See [CONTRIBUTING.md](CONTRIBUTING.md) for the contribution workflow and
[DEVELOPERS.md](DEVELOPERS.md) for architecture and extension guidance.

---

## License

OpenSportsLib is available under dual licensing.

### Open source license
[AGPL 3.0](LICENSE) for research, academic, and community use.

### Commercial license
For proprietary or commercial deployment, please refer to [LICENSE-COMMERCIAL](LICENSE-COMMERCIAL).

---

## Citation

If you use OpenSportsLib in your research, please cite the project.

```bibtex
@misc{opensportslib,
  title={OpenSportsLib},
  author={OpenSportsLab},
  year={2026},
  howpublished={\url{https://github.com/OpenSportsLab/opensportslib}}
}
```

---

## Acknowledgments

OpenSportsLib is developed within the broader OpenSportsLab effort for sports
video understanding. Core contributors affiliated with KAUST include:

- [Jeet Vora](https://jeetv.github.io/) — Remote Research Engineer
- [Dr. Merey Ramazanova](https://meryusha.github.io/) — Post-Doc
- [Dr. Silvio Giancola](https://www.silviogiancola.com/) — Research Scientist
