Release KITTI-C2L v1.0.0: documented self-contained benchmark, loader and baselines
db613b6 verified Download code/scripts/check_release_loading.py from mcocheteux/KITTI-C2L-Dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.42 kB
-
https://huggingface.co/datasets/mcocheteux/KITTI-C2L-Dataset/resolve/main/code/scripts/check_release_loading.py
- Command line
-
hf download hf://datasets/mcocheteux/KITTI-C2L-Dataset/code/scripts/check_release_loading.py
-
curl -L -o check_release_loading.py https://huggingface.co/datasets/mcocheteux/KITTI-C2L-Dataset/resolve/main/code/scripts/check_release_loading.py
1.42 kB
| """Check both dataset-card configurations through Hugging Face's actual local loader.""" | |
| from __future__ import annotations | |
| import argparse | |
| from pathlib import Path | |
| from datasets import get_dataset_config_names, load_dataset | |
| def main() -> None: | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| parser.add_argument("--root", type=Path, default=Path(__file__).resolve().parents[1]) | |
| args = parser.parse_args() | |
| root = str(args.root.resolve()) | |
| expected = { | |
| "metadata": {"train": 98040, "test": 13960}, | |
| "windows": {"train": 3290, "test": 475}, | |
| } | |
| if set(get_dataset_config_names(root)) != set(expected): | |
| raise ValueError("Unexpected dataset configurations") | |
| for config, sizes in expected.items(): | |
| dataset = load_dataset(root, config) | |
| actual = {split: len(rows) for split, rows in dataset.items()} | |
| if actual != sizes: | |
| raise ValueError(f"{config}: expected {sizes}, got {actual}") | |
| train = dataset["train"] | |
| val_mask = [sequence == "07" for sequence in train["sequence"]] | |
| validation_rows = sum(val_mask) | |
| expected_val = 5505 if config == "metadata" else 185 | |
| if validation_rows != expected_val: | |
| raise ValueError(f"{config}: invalid validation holdout") | |
| print(f"{config}: {actual}, sequence-07 validation rows: {validation_rows}") | |
| if __name__ == "__main__": | |
| main() | |