Advanced¶
You normally do not need anything on this page: datasets and evaluators cover the benchmark workflow end to end.
Scenario index¶
Datasets build a ScenarioIndex internally from the root/split
you pass them, so you normally never construct one yourself (for the
evaluator identifiers, use
WithIdentifiers or a composite dataset — see
Evaluating your model). It is documented here because the keyword arguments
datasets forward to it (clip_len, stride, anomaly_types,
towns, download, parts) are defined on its constructor.
- class carlanomaly.ScenarioIndex(root, split='train', clip_len=1, stride=None, anomaly_types=None, towns=None, download=False, parts=None, download_verify=True)[source]¶
Bases:
objectDiscovers scenarios and builds a flat sliding-window index.
Datasets construct this internally from the
root/splityou pass them, so you normally never instantiate it directly. Datasets built with the same parameters produce identical indices, sodataset_a[i]anddataset_b[i]always refer to the same scenario and timestep window.- Parameters:
root – Path to the CarlAnomaly root directory (contains
train/andtest/).split –
'train','test_normal','test_anomaly', or'test'(= normal + anomaly combined).clip_len – Number of consecutive timesteps per item.
stride – Sliding-window stride. Defaults to
clip_len.anomaly_types – Restrict test anomaly clips to a subset of types.
towns – Restrict to scenarios from specific towns.
download – If
True, download and extract the required dataset archives intoroot(viacarlanomaly.download.ensure_parts()) before discovery. Idempotent: already-present archives are skipped.parts – Which dataset parts to download when
download=True. Defaults to["base"](the minimum needed for scenario discovery). Add more (e.g."lidar","depth","camera-extended") for the modalities you intend to load.download_verify – Verify SHA-256 checksums of downloaded archives (default
True).
- Parameters:
Constants¶
- carlanomaly.CAMERAS = ("front", "left", "right", "rear")¶
Built-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.
If the argument is a tuple, the return value is the same object.
- carlanomaly.ANOMALY_TYPES = ('change-weather', 'running-pedestrian', 'spawn-props', 'steer-driver', 'street-light-flicker', 'traffic-light-flicker', 'traffic-light-off', 'traffic-light-yellow-blinking', 'vanish-actor')¶
Built-in immutable sequence.
If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable’s items.
If the argument is a tuple, the return value is the same object.