Download utilities¶
- carlanomaly.download.PARTS: Dict[str, str] = {'base': 'Front camera + segmentation, GNSS/IMU/weather/actions/collisions, and (test only) front anomaly masks + timestep labels.', 'camera-extended': 'Left/right/rear RGB + segmentation, and (test only) their anomaly masks.', 'depth': 'Depth maps for all four cameras.', 'kitti': 'LiDAR labels in KITTI format.', 'lidar': 'LiDAR point clouds, and (test only) per-point anomaly labels.'}¶
All downloadable parts, with a short human-readable description of the directories each one contributes to a scenario (see
package_dataset.sh).
- carlanomaly.ensure_parts(root, parts, splits=None, *, verify=True, progress=True, keep_archive=False, base_url=None)[source]¶
Download and extract dataset parts into
root(idempotent).- Parameters:
root – Dataset root (archives extract to
root/{train,test}/...).parts – One part name or a sequence of them (see
PARTS).splits –
'train','test', or both. Defaults to both.verify – Verify the SHA-256 checksum after download. When no checksum is published for an archive, a warning is logged and the file is kept.
progress – Show a download progress bar (tqdm if available, else textual).
keep_archive – Keep the downloaded
.tar.gzafter extraction (default: delete it).base_url – Override
DATA_BASE_URLfor this call.
- Return type:
- Parameters:
- carlanomaly.part_for(modality, direction=None)[source]¶
Return the archive part that contains a given modality/direction.
Depth maps are bundled together regardless of camera direction; the RGB, segmentation and anomaly-label modalities split by direction:
frontis inbase, the other camera directions are incamera-extended, and sensor labels forlidarlive in thelidarpart.
- carlanomaly.download.part_present(root, part, split)[source]¶
Whether
partof archive splitsplitis already inroot.True if the downloader left its marker, or if every scenario of the split has the part’s probe directory (
PART_PROBES), i.e. the archive was downloaded and extracted by hand. An interrupted manual extraction of a non-base part is caught; one ofbaseis not (the missing scenarios simply do not exist yet).
- carlanomaly.download.require_parts(root, parts, splits)[source]¶
Raise
FileNotFoundErrorif any ofpartsis missing fromroot.The message names the missing parts and both ways to fetch them.
Datasets do not download by default. With download=True they call
ensure_parts(), which skips parts that are already in root: those it
downloaded itself (marker file) and those extracted by hand
(part_present()).
CLI¶
The carlanomaly-download command-line tool wraps ensure_parts():
# List available parts
carlanomaly-download --list
# Download the base part (front camera + tabular + test labels)
carlanomaly-download --root /data/carlanomaly --parts base
# Download LiDAR data for the test split only
carlanomaly-download --root /data/carlanomaly --parts lidar --splits test