Metadata-Version: 2.3
Name: commonroad-labeling
Version: 2025.1.1
Summary: Automatic labeling of CommonRoad scenarios.
License: BSD-3-Clause
Author: Florian Finkeldei
Author-email: florian.finkeldei@tum.de
Requires-Python: >=3.10
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: commonroad-clcs (>=2025.1.1,<2026.0.0)
Requires-Dist: commonroad-crime (>=0.4.4)
Requires-Dist: commonroad-drivability-checker (>=2025.1,<2026.0)
Requires-Dist: commonroad-io (>=2024.3)
Requires-Dist: commonroad-route-planner (>=2025.1.0)
Requires-Dist: commonroad_vehicle_models (>=3.0.2)
Requires-Dist: imageio (>=2.13.5)
Requires-Dist: matplotlib (>=3.5.2,<3.9)
Requires-Dist: methodtools (>=0.4.5,<0.5.0)
Requires-Dist: networkx (>=2.2)
Requires-Dist: numpy (>=1.22)
Requires-Dist: omegaconf (>=2.1.1)
Requires-Dist: pandas (>=2.2.2,<3.0.0)
Requires-Dist: scikit-learn (>=1.4,<2.0)
Requires-Dist: scipy (>=1.5.2)
Requires-Dist: triangle (>=20230923)
Project-URL: Documentation, https://cps.pages.gitlab.lrz.de/commonroad/automatic-scenario-labeling
Description-Content-Type: text/markdown

# CommonRoad Automatic Scenario Labeling

[![PyPI pyversions](https://img.shields.io/pypi/pyversions/commonroad-labeling.svg)](https://pypi.python.org/pypi/commonroad-labeling/)
[![PyPI version fury.io](https://badge.fury.io/py/commonroad-labeling.svg)](https://pypi.python.org/pypi/commonroad-labeling/)
[![PyPI download week](https://img.shields.io/pypi/dw/commonroad-labeling.svg?label=PyPI%20downloads)](https://pypi.python.org/pypi/commonroad-labeling/)
[![PyPI download month](https://img.shields.io/pypi/dm/commonroad-labeling.svg?label=PyPI%20downloads)](https://pypi.python.org/pypi/commonroad-labeling/)
[![PyPI license](https://img.shields.io/pypi/l/commonroad-labeling.svg)](https://pypi.python.org/pypi/commonroad-labeling/)

Automatically assign correct labels to CommonRoad scenarios and check whether existing tags are correct.

The full documentation of the API and introductory examples can be found at [cps.pages.gitlab.lrz.de/commonroad/automatic-scenario-labeling](https://cps.pages.gitlab.lrz.de/commonroad/automatic-scenario-labeling).

## Quick Start

### Installation

```sh
$ pip install commonroad-labeling
```

### Usage Example

```python
from pathlib import Path

from commonroad_labeling.common.general import get_detected_tags_by_file

# specify a directory and detect tags
tags_by_file = get_detected_tags_by_file(Path.cwd().joinpath("path", "to", "directory"))
```

## Sketched Functionality
1. Load scenario using commonroad-io.
2. Read all currently assigned scenario tags.
3. Determine which tags are correct.
   1. Using formalized rules.
   2. Using traffic rule monitor.
   3. Using criticality metrics.
4. Check whether the tags are consistent with the previously assigned tags. → Warning if necessary
5. Overwrite scenario with corrected tags.

