Spaces:
Running
Running
Download processor/scripts/repack_project_chunks.py from Stouching-Robotics/DataFlowing: direct link, hf CLI and curl.
- Browser
- Download file 834 Bytes
-
https://huggingface.co/spaces/Stouching-Robotics/DataFlowing/resolve/main/processor/scripts/repack_project_chunks.py
- Command line
-
hf download hf://spaces/Stouching-Robotics/DataFlowing/processor/scripts/repack_project_chunks.py
-
curl -L -o repack_project_chunks.py https://huggingface.co/spaces/Stouching-Robotics/DataFlowing/resolve/main/processor/scripts/repack_project_chunks.py
834 Bytes
| #!/usr/bin/env python3 | |
| """Repack a project into LeRobot v2.1's 1000-episode chunks.""" | |
| from __future__ import annotations | |
| import argparse | |
| import json | |
| import sys | |
| from pathlib import Path | |
| sys.path.insert(0, str(Path(__file__).resolve().parents[1])) | |
| def main() -> int: | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("project_root", type=Path) | |
| parser.add_argument("--drop-backup", action="store_true", | |
| help="remove the pre-repack tree after verification") | |
| args = parser.parse_args() | |
| from app.project_dataset import repack_project_chunks | |
| result = repack_project_chunks( | |
| args.project_root, | |
| keep_backup=not args.drop_backup, | |
| ) | |
| print(json.dumps(result, ensure_ascii=False, indent=2)) | |
| return 0 | |
| if __name__ == "__main__": | |
| raise SystemExit(main()) | |