diff --git a/src/lerobot/policies/pi05_full/annotate/annotate_libero.sh b/src/lerobot/policies/pi05_full/annotate/annotate_libero.sh index ab3bad68c..0e5a3d8f0 100644 --- a/src/lerobot/policies/pi05_full/annotate/annotate_libero.sh +++ b/src/lerobot/policies/pi05_full/annotate/annotate_libero.sh @@ -16,12 +16,13 @@ TEMPERATURE=0.9 SAMPLE_INTERVAL=5.0 # generate dialogue every 1 second (all episodes processed) # Run subtask annotation -# python /admin/home/jade_choghari/lerobot/src/lerobot/policies/pi05_full/annotate/subtask_annotate.py \ -# --repo-id "$REPO_ID" \ -# --video-key observation.images.image \ -# --output-dir "$OUTPUT_DIR" \ -# --output-repo-id "jadechoghari/libero-annotate" \ -# --batch-size "$BATCH_SIZE" \ +python /admin/home/jade_choghari/lerobot/src/lerobot/policies/pi05_full/annotate/subtask_annotate.py \ + --repo-id "$REPO_ID" \ + --video-key observation.images.image \ + --output-dir "$OUTPUT_DIR" \ + --skip-existing \ + --output-repo-id "jadechoghari/libero-annotate" \ + --batch-size "$BATCH_SIZE" \ # run synthetic data generation (all episodes processed) # python examples/dataset/annotate_pgen.py \ # --repo-id "$REPO_ID" \ @@ -40,10 +41,10 @@ SAMPLE_INTERVAL=5.0 # generate dialogue every 1 second (all episodes processed) # add --push-to-hub flag # efficient batch processing: 4 episodes at once -python /admin/home/jade_choghari/lerobot/src/lerobot/policies/pi05_full/annotate/high_level_annotate.py \ - --repo-id "$REPO_ID" \ - --output-dir "$OUTPUT_DIR" \ - --video-mode \ - --video-key observation.images.image \ - --video-batch-size "$BATCH_SIZE" \ - --sample-interval 5.0 +# python /admin/home/jade_choghari/lerobot/src/lerobot/policies/pi05_full/annotate/high_level_annotate.py \ +# --repo-id "$REPO_ID" \ +# --output-dir "$OUTPUT_DIR" \ +# --video-mode \ +# --video-key observation.images.image \ +# --video-batch-size "$BATCH_SIZE" \ +# --sample-interval 5.0 diff --git a/src/lerobot/policies/pi05_full/annotate/subtask_annotate.py b/src/lerobot/policies/pi05_full/annotate/subtask_annotate.py index bf5a98e52..092e9a8cd 100644 --- a/src/lerobot/policies/pi05_full/annotate/subtask_annotate.py +++ b/src/lerobot/policies/pi05_full/annotate/subtask_annotate.py @@ -703,12 +703,19 @@ class SkillAnnotator: if skip_existing: existing_annotations = load_skill_annotations(dataset.root) if existing_annotations and "episodes" in existing_annotations: - existing_episode_indices = {int(idx) for idx in existing_annotations["episodes"].keys()} + # Only skip episodes that exist AND have non-empty skills + existing_episode_indices = set() + for idx_str, episode_data in existing_annotations["episodes"].items(): + idx = int(idx_str) + # Check if skills list exists and is not empty + if "skills" in episode_data and episode_data["skills"]: + existing_episode_indices.add(idx) + original_count = len(episode_indices) episode_indices = [ep for ep in episode_indices if ep not in existing_episode_indices] skipped_count = original_count - len(episode_indices) if skipped_count > 0: - self.console.print(f"[cyan]Skipping {skipped_count} episodes with existing annotations[/cyan]") + self.console.print(f"[cyan]Skipping {skipped_count} episodes with existing non-empty annotations[/cyan]") if not episode_indices: self.console.print("[yellow]No episodes to annotate (all already annotated)[/yellow]")