| |
| """Verify the full online GWAM final graph path on a live RoboCasa env.""" |
| from __future__ import annotations |
|
|
| import argparse |
| import json |
| import subprocess |
| import sys |
| import tempfile |
| from pathlib import Path |
|
|
|
|
| def main() -> int: |
| ap = argparse.ArgumentParser() |
| ap.add_argument('--package-root', type=Path, default=Path(__file__).resolve().parents[1]) |
| ap.add_argument('--task', default='OpenDrawer') |
| ap.add_argument('--robots', default='PandaOmron') |
| ap.add_argument('--device', default='cuda') |
| ap.add_argument('--visual-backend', choices=['sam2', 'fake'], default='sam2') |
| args = ap.parse_args() |
| example = args.package_root / 'examples/realtime_env_graph_eval_loop.py' |
| with tempfile.TemporaryDirectory(prefix='gwam-final-graph-verify-') as td: |
| out = Path(td) / 'summary.json' |
| cmd = [ |
| sys.executable, |
| str(example), |
| '--task', args.task, |
| '--robots', args.robots, |
| '--steps', '1', |
| '--visual-backend', args.visual_backend, |
| '--device', args.device, |
| '--json-output', str(out), |
| ] |
| subprocess.run(cmd, check=True) |
| data = json.loads(out.read_text()) |
| row = data['summaries'][0] |
| assert row['final_graph'] is True, row |
| assert row['N_real'] > 1, row |
| assert row['D_node'] == 342, row |
| assert row['D_edge'] == 8, row |
| assert row['first_slots'][0] == 0, row |
| assert row['visual_features_written'] >= 0, row |
| assert row['invalid_visible_pairs'] >= 0, row |
| |
| |
| assert row['rgb_view_count'] == 3, row |
| assert row['rgb_aligned_with_view_ids'] is True, row |
| assert row['rgb_cameras'] == ['robot0_agentview_right', 'robot0_agentview_left', 'robot0_eye_in_hand'], row |
| for shape in row['rgb_shapes'].values(): |
| assert shape == [256, 256, 3], row |
| print('verify_realtime_final_graph_ok', json.dumps(row, sort_keys=True)) |
| return 0 |
|
|
|
|
| if __name__ == '__main__': |
| raise SystemExit(main()) |
|
|