Expose aligned multi-view RGB for realtime final graphs
Browse files
examples/realtime_env_graph_eval_loop.py
CHANGED
|
@@ -4,7 +4,7 @@
|
|
| 4 |
This is a template, not a benchmark script. It requires a working local RoboCasa
|
| 5 |
installation and simulator assets. For the full final graph it also requires the
|
| 6 |
same Phase-2 visual stack used locally: SAM2.1 Hiera-B+ checkpoint and CLIP.
|
| 7 |
-
The HF dataset does not redistribute RoboCasa
|
| 8 |
"""
|
| 9 |
from __future__ import annotations
|
| 10 |
|
|
@@ -96,6 +96,9 @@ def make_visual_backend(name: str, device: str | None, sam2_root: Path | None, s
|
|
| 96 |
def summarize_graph(t: int, snapshot: dict) -> dict:
|
| 97 |
graph = snapshot["gnn_graph"]
|
| 98 |
visual = snapshot.get("visual_features_sparse") or {}
|
|
|
|
|
|
|
|
|
|
| 99 |
return {
|
| 100 |
"t": t,
|
| 101 |
"N_real": int(graph["metadata"]["N_real"]),
|
|
@@ -106,6 +109,10 @@ def summarize_graph(t: int, snapshot: dict) -> dict:
|
|
| 106 |
"final_graph": bool(graph["metadata"].get("include_visual")),
|
| 107 |
"visual_features_written": int((visual.get("summary") or {}).get("features_written", 0)),
|
| 108 |
"invalid_visible_pairs": int((visual.get("summary") or {}).get("invalid_visible_pairs", 0)),
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
}
|
| 110 |
|
| 111 |
|
|
|
|
| 4 |
This is a template, not a benchmark script. It requires a working local RoboCasa
|
| 5 |
installation and simulator assets. For the full final graph it also requires the
|
| 6 |
same Phase-2 visual stack used locally: SAM2.1 Hiera-B+ checkpoint and CLIP.
|
| 7 |
+
The HF dataset does not redistribute RoboCasa/MuJoCo assets; SAM2/CLIP checkpoints are bundled under models/ with upstream licenses.
|
| 8 |
"""
|
| 9 |
from __future__ import annotations
|
| 10 |
|
|
|
|
| 96 |
def summarize_graph(t: int, snapshot: dict) -> dict:
|
| 97 |
graph = snapshot["gnn_graph"]
|
| 98 |
visual = snapshot.get("visual_features_sparse") or {}
|
| 99 |
+
rgb_frames = snapshot.get("rgb_frames") or {}
|
| 100 |
+
rgb_cameras = list(snapshot.get("rgb_frame_cameras") or [])
|
| 101 |
+
rgb_shapes = {str(k): list(np.asarray(v).shape) for k, v in sorted(rgb_frames.items())}
|
| 102 |
return {
|
| 103 |
"t": t,
|
| 104 |
"N_real": int(graph["metadata"]["N_real"]),
|
|
|
|
| 109 |
"final_graph": bool(graph["metadata"].get("include_visual")),
|
| 110 |
"visual_features_written": int((visual.get("summary") or {}).get("features_written", 0)),
|
| 111 |
"invalid_visible_pairs": int((visual.get("summary") or {}).get("invalid_visible_pairs", 0)),
|
| 112 |
+
"rgb_view_count": len(rgb_frames),
|
| 113 |
+
"rgb_cameras": rgb_cameras,
|
| 114 |
+
"rgb_shapes": rgb_shapes,
|
| 115 |
+
"rgb_aligned_with_view_ids": bool(len(rgb_frames) == len(rgb_cameras) == 3),
|
| 116 |
}
|
| 117 |
|
| 118 |
|