Download code/tools/export_clips.py from MRBSTUDIO/AGT: direct link, hf CLI and curl.
- Browser
- Download file 1.28 kB
-
https://huggingface.co/MRBSTUDIO/AGT/resolve/main/code/tools/export_clips.py
- Command line
-
hf download hf://MRBSTUDIO/AGT/code/tools/export_clips.py
-
curl -L -o export_clips.py https://huggingface.co/MRBSTUDIO/AGT/resolve/main/code/tools/export_clips.py
1.28 kB
| from __future__ import annotations | |
| import argparse | |
| import json | |
| import sys | |
| from pathlib import Path | |
| sys.path.insert(0, str(Path(__file__).resolve().parents[1])) | |
| from agt.dataset.export import export_clip_inputs | |
| def main() -> int: | |
| parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter) | |
| parser.add_argument('--data-root', type=Path, required=True) | |
| parser.add_argument('--split', required=True, choices=('val', 'test')) | |
| parser.add_argument('--protocol', default='partial', help='protocol name (agt/data/protocols) or JSON path') | |
| parser.add_argument('--time-of-day', default='both', choices=('day', 'night', 'both')) | |
| parser.add_argument('--out', type=Path, help='default <data-root>/exports/<eval set>/waymo__<time>/<protocol id[:12]>') | |
| parser.add_argument('--scene', action='append', help='only these scenes (repeatable)') | |
| parser.add_argument('--workers', type=int, default=8) | |
| args = parser.parse_args() | |
| result = export_clip_inputs(args.data_root, args.split, args.protocol, args.out, time_of_day=args.time_of_day, | |
| workers=args.workers, scene_ids=args.scene) | |
| print(json.dumps(result, indent=1), flush=True) | |
| return 0 | |
| if __name__ == '__main__': | |
| sys.exit(main()) | |