Skip to content

How to Collect 50 Good LeRobot Demonstrations: Start-Position Design and Removing Bad Episodes

Plan 50 LeRobot teleoperation demos by zone, fix cameras and lighting, decide what to re-record, then find and delete bad episodes with official LeRobot tools.

Contents

Key takeaways

  1. The official starting point is at least 50 episodes at 10 per location, with fixed cameras and consistent grasping.
  2. Recording time is episode length plus reset time. The 60-second defaults mean 100 minutes for 50 episodes; 20 and 10 seconds bring that to 25 minutes.
  3. Re-record on the spot with the r key. After the session, inspect with Dataset Visualizer and lerobot-replay, then remove bad episodes using delete_episodes in lerobot-edit-dataset.
  4. The official framing test: could a person do the task while looking only at the camera images?

If you are collecting your first SO-101 dataset, the biggest variable is not a training setting but how those 50 demonstrations are distributed. Follow this guide and you will end up with a dataset recorded from a planned set of start positions, with bad episodes found and removed. Installation and training commands are in the SO-101 ACT training guide, and policy choice is in the demo-count selection guide.

Why plan the distribution first

Imitation policies do poorly on situations absent from their data. The ACT paper reports 80-90% success on six real tasks from about ten minutes of demonstrations on low-cost hardware, a result that depends on a well-scoped task. Collect all 50 from one spot and you get a policy that only works at that spot. Spread them too widely and each region is starved of examples.

The official documentation puts numbers on that balance. Start with grasping an object at different locations and placing it in a bin, and record at least 50 episodes at 10 per location. Once grasping is reliable, gradually add locations, grasp techniques and camera positions.

What you need before starting

  • A calibrated SO-101 leader and follower pair
  • One or two fixed cameras
  • A Hugging Face token with write access
  • The dataset tools extra: pip install 'lerobot[dataset]'

Step 1: Divide start positions into zones

Split the workspace into five zones and assign ten episodes each. The zone layout is not an official rule; it is one way to apply “10 per location” to a real table.

ZoneObject startTargetFirst index (example)Last index (example)
AFront left1009
BFront right101019
CCenter102029
DRear left103039
ERear right104049

Mark the zones with tape and vary position and orientation slightly inside each. Recording zone by zone means episode numbers alone will later tell you whether failures cluster in one area.

Estimate the session length beforehand. The defaults are 60 seconds each for the episode and the reset.

Ttotal=N×(tepisode+treset) T_{\text{total}} = N \times (t_{\text{episode}} + t_{\text{reset}})
SettingEpisodeReset50 episodesFrames at 30 fps
Defaults60 s60 s100 min90,000
Assumed short pick-and-place20 s10 s25 min30,000

If the task finishes within 15 seconds there is no reason to record the default window. Set the episode slightly longer than the task and press n to move on when you finish early. Frame count also feeds the training time estimate.

Step 2: Lock down cameras and lighting

The camera documentation and Hugging Face’s dataset checklist combine into these criteria.

ItemCriterionSource
Camera positionRigidly mounted, never moved between recording and deploymentCamera docs
FramingObject, gripper and target visible in at least one cameraCamera docs
LightingDiffuse and consistent; avoid direct sun, reflections, moving shadowsCamera docs
Resolution640×480 at 30 fps is enough for most tasksCamera docs
ViewsTwo camera views preferredChecklist
Motion in frameLeader arm and human limbs stay out of frameChecklist
Camera namesNamed by location, such as images.top or images.wrist.leftChecklist
Task textA concrete objective, 25-50 charactersChecklist

The official framing test is simple: without looking at the robot, could you do the task using only the camera images? If the gripper hides the object for long stretches, add a wrist camera or move the existing one.

Step 3: Record against a clear standard

Consistent grasping is what the documentation explicitly requires. The other rows below translate that into things you can check at the bench, and should be read as recommendations.

CheckGood demonstrationRe-record
SpeedSimilar pace across demonstrationsPauses or sudden bursts
Gripper timingCloses once after contactOpens and closes repeatedly
ApproachSame direction each timeApproach direction varies widely
OcclusionObject stays visibleArm hides the object for long periods
End poseReturns to a defined poseEnds in arbitrary poses
lerobot-record \
  --robot.type=so101_follower \
  --robot.port=/dev/ttyACM0 \
  --robot.id=my_follower_arm \
  --robot.cameras="{ top: {type: opencv, index_or_path: 0, width: 640, height: 480, fps: 30}, wrist: {type: opencv, index_or_path: 1, width: 640, height: 480, fps: 30}}" \
  --teleop.type=so101_leader \
  --teleop.port=/dev/ttyACM1 \
  --teleop.id=my_leader_arm \
  --dataset.repo_id=${HF_USER}/so101_cup_to_bin \
  --dataset.num_episodes=50 \
  --dataset.episode_time_s=20 \
  --dataset.reset_time_s=10 \
  --dataset.single_task="Pick up the red cup and place it in the bin"

There are three keyboard controls while recording. → or n ends the current segment early, ← or r cancels the episode and re-records it, and ESC or q stops the session, encodes the video and uploads.

Rejecting an episode costs least at the moment it happens. Press r if you knocked the object out of place, teleoperation dropped, or the task did not finish. A near-miss that you corrected right away can stay: it shows the policy how to recover from the same drift at runtime. Keep these to a small share, though, or the policy starts learning hesitation.

Step 4: Spot suspects with visualization

Open the dataset in the LeRobot Dataset Visualizer. According to the dataset tools guide, camera streams play in sync above per-joint state and action charts, and the Advanced menu offers statistics and filtering to flag problematic episodes.

Look for these patterns in the charts.

  1. Flat stretches: Long periods without motion usually mean teleoperation stalled.
  2. Spikes: A big jump in a single frame can indicate a bus error or a calibration problem.
  3. Length outliers: Episodes much longer or shorter than the rest suggest hesitation or an early stop.
  4. Zone clustering: If suspects concentrate in one zone, fix framing or reach there first.

To inspect locally in Rerun:

lerobot-dataset-viz --repo-id ${HF_USER}/so101_cup_to_bin --episode-index 7

Step 5: Use replay to separate causes

Play suspect episodes back on the real robot. If replay works but the trained policy fails, suspect the demonstration distribution. If replay itself misses the object, the cause may be the arm’s repeatability or inconsistent object placement.

lerobot-replay \
  --robot.type=so101_follower \
  --robot.port=/dev/ttyACM0 \
  --robot.id=my_follower_arm \
  --dataset.repo_id=${HF_USER}/so101_cup_to_bin \
  --dataset.episode=7

Step 6: Delete bad episodes and keep the original

lerobot-edit-dataset can write a new dataset without the listed episodes. Save under a new name so that you can change your criteria later.

lerobot-edit-dataset \
  --repo_id ${HF_USER}/so101_cup_to_bin \
  --new_repo_id ${HF_USER}/so101_cup_to_bin_clean \
  --operation.type delete_episodes \
  --operation.episode_indices "[3, 7, 28]"

Recount episodes per zone afterwards. If one zone lost far more than the others, rebalance it with --resume=true, and remember that --dataset.num_episodes then means the number to add.

Four dataset checks before you start training

Confirm that zone counts are balanced, that every demonstration can be understood from the camera view, that the task sentence is specific, and that the original and cleaned datasets are stored separately. Then train an ACT baseline on this dataset, so that later differences between models can be attributed to the model rather than to the data.

Common mistakes

  • Varying position, lighting and grasp style all at once, so a small dataset never converges
  • Moving a camera between recording and deployment
  • Recording with the leader arm or the operator’s arm in frame
  • Editing the original dataset directly and losing the option to change your rejection criteria

Pre-flight checklist

  • Start positions are divided into zones with a target count for each
  • Cameras are rigidly mounted and the task is doable from the camera view alone
  • Lighting is even, with no direct sun or moving shadows
  • --dataset.episode_time_s is slightly longer than the task
  • Episode indices to delete are recorded and results go to a new repo_id

Frequently asked questions

Is 50 episodes enough for any policy?
The ACT paper reports 80-90% success from roughly 50 demonstrations per task, but this varies with task and hardware. Choosing a policy by dataset size is covered in the demo-count guide linked above.
Can I add episodes to a finished dataset?
Yes. Pass –resume=true and –dataset.root with the same command. Note that –dataset.num_episodes then means the number of additional episodes, not the target total.

Sources & verification

  1. Hugging Face LeRobot Docs — Imitation Learning on Real-World Robots
  2. Hugging Face LeRobot Docs — Cameras
  3. Hugging Face LeRobot Docs — Using Dataset Tools
  4. Hugging Face LeRobot Docs — Compute HW Guide
  5. Hugging Face Blog — LeRobot dataset quality checklist
  6. Zhao et al., Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware (arXiv:2304.13705)

Last verified: