| #!/usr/bin/env python3 | |
| """Push an already-created local LeRobot dataset to the Hugging Face Hub. | |
| Run inside the container: | |
| lerobot-python push_dataset.py \ | |
| --repo_id JSHNSL/ffw_sg2_ltable \ | |
| --root ./datasets/lerobot/20260709_1536 | |
| """ | |
| import argparse | |
| from lerobot.datasets.lerobot_dataset import LeRobotDataset | |
| def main(): | |
| parser = argparse.ArgumentParser(description="Push a local LeRobot dataset to the HF Hub") | |
| parser.add_argument("--repo_id", required=True, help="Target Hub repo, e.g. JSHNSL/ffw_sg2_ltable") | |
| parser.add_argument("--root", required=True, help="Local dataset folder (contains data/ videos/ meta/)") | |
| parser.add_argument("--private", action="store_true", help="Upload as a private dataset") | |
| args = parser.parse_args() | |
| ds = LeRobotDataset(repo_id=args.repo_id, root=args.root) | |
| print(f"Loaded {ds.num_episodes} episodes / {ds.num_frames} frames from {args.root}") | |
| ds.push_to_hub(private=args.private) | |
| print(f"Pushed to https://huggingface.co/datasets/{args.repo_id}") | |
| if __name__ == "__main__": | |
| main() | |