Download tools/inspect_sample.py from LianeMarilin/CADBench-Extended-Multimodal-Dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/datasets/LianeMarilin/CADBench-Extended-Multimodal-Dataset/resolve/main/tools/inspect_sample.py
- Command line
-
hf download hf://datasets/LianeMarilin/CADBench-Extended-Multimodal-Dataset/tools/inspect_sample.py
-
curl -L -o inspect_sample.py https://huggingface.co/datasets/LianeMarilin/CADBench-Extended-Multimodal-Dataset/resolve/main/tools/inspect_sample.py
1.07 kB
| #!/usr/bin/env python3 | |
| """Print a compact human-readable summary for one dataset sample.""" | |
| import json | |
| import sys | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| INDEX = ROOT / "annotations" / "metadata_extended.jsonl" | |
| SAMPLE_ID = sys.argv[1] if len(sys.argv) > 1 else "CBX100_0001" | |
| sample = None | |
| with INDEX.open(encoding="utf-8") as handle: | |
| for line in handle: | |
| candidate = json.loads(line) | |
| if candidate["sample_id"] == SAMPLE_ID: | |
| sample = candidate | |
| break | |
| if sample is None: | |
| raise SystemExit(f"Unknown sample_id: {SAMPLE_ID}") | |
| print(f"sample_id : {sample['sample_id']}") | |
| print(f"difficulty: {sample['label']}") | |
| print(f"split : {sample['split']}") | |
| print(f"author : {sample['source']['author']}") | |
| print(f"source : {sample['source']['provenance']}") | |
| print(f"triangles : {sample['geometry']['clean']['triangle_count']}") | |
| print(f"description.zh: {sample['descriptions']['zh']}") | |
| print("modalities:") | |
| for key, value in sample["modalities"].items(): | |
| print(f" {key:20s} {ROOT / value}") | |