lsnu commited on
Commit
7b8de56
·
verified ·
1 Parent(s): ba3985e

Add fast all-metrics render path

Browse files
code/scripts/render_oven_metric_frame.py CHANGED
@@ -660,9 +660,26 @@ def main() -> int:
660
  frame_row = matches.iloc[0]
661
  else:
662
  frame_row = frame_df.iloc[int(args.frame_index)]
663
- demo = _load_demo(episode_dir)
664
  debug_jsonl = Path(args.debug_jsonl) if args.debug_jsonl else None
665
  debug_row = _load_debug_row(debug_jsonl, int(args.frame_index))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
666
 
667
  env = _launch_replay_env()
668
  try:
@@ -676,10 +693,6 @@ def main() -> int:
676
  for obj in task._scene.robot.left_gripper.get_grasped_objects()
677
  )
678
 
679
- visibility_out = Path(args.visibility_out) if args.visibility_out else None
680
- path_out = Path(args.path_out) if args.path_out else None
681
- all_out = Path(args.all_out) if args.all_out else None
682
-
683
  if visibility_out is not None:
684
  visibility_image = _compose_visibility_focus(
685
  episode_dir=episode_dir,
 
660
  frame_row = matches.iloc[0]
661
  else:
662
  frame_row = frame_df.iloc[int(args.frame_index)]
 
663
  debug_jsonl = Path(args.debug_jsonl) if args.debug_jsonl else None
664
  debug_row = _load_debug_row(debug_jsonl, int(args.frame_index))
665
+ visibility_out = Path(args.visibility_out) if args.visibility_out else None
666
+ path_out = Path(args.path_out) if args.path_out else None
667
+ all_out = Path(args.all_out) if args.all_out else None
668
+
669
+ # The all-metrics panel only depends on RGB frames plus the dense CSV row.
670
+ # Skip simulator replay entirely when no geometric overlays are requested.
671
+ if all_out is not None and visibility_out is None and path_out is None:
672
+ all_image = _compose_all_metrics(
673
+ episode_name=episode_dir.name,
674
+ episode_dir=episode_dir,
675
+ demo=None,
676
+ frame_index=int(args.frame_index),
677
+ frame_row=frame_row,
678
+ )
679
+ _save_if_requested(all_image, all_out)
680
+ return 0
681
+
682
+ demo = _load_demo(episode_dir)
683
 
684
  env = _launch_replay_env()
685
  try:
 
693
  for obj in task._scene.robot.left_gripper.get_grasped_objects()
694
  )
695
 
 
 
 
 
696
  if visibility_out is not None:
697
  visibility_image = _compose_visibility_focus(
698
  episode_dir=episode_dir,