File size: 1,155 Bytes
9ffd3e8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | """Training copy of a phase 2 dataset with only the cameras the policy uses.
SmolVLA is trained on the overhead and wrist views; the dataset keeps the rover view
for later. LeRobot's remove_feature writes a new dataset without the dropped cameras,
so training never decodes their videos. The original is untouched.
Run: .venv/bin/python sim/make_train_view.py data/so101_chess_sim data/so101_chess_sim_train
"""
from __future__ import annotations
import argparse
def main():
from lerobot.datasets.dataset_tools import remove_feature
from lerobot.datasets.lerobot_dataset import LeRobotDataset
ap = argparse.ArgumentParser(description=__doc__)
ap.add_argument("src")
ap.add_argument("dst")
ap.add_argument("--drop", nargs="+", default=["observation.images.rover"])
args = ap.parse_args()
ds = LeRobotDataset("local/so101_chess_sim", root=args.src)
out = remove_feature(ds, feature_names=args.drop, output_dir=args.dst, repo_id="local/so101_chess_sim_train")
print(f"{args.dst}: {out.num_episodes} episodes, {out.num_frames} frames, features {list(out.meta.features)}")
if __name__ == "__main__":
main()
|