ChangChrisLiu commited on
Commit
4bf3d68
·
verified ·
1 Parent(s): f82c0e8

Expose aligned multi-view RGB for realtime final graphs

Browse files
Files changed (1) hide show
  1. docs/REALTIME_ENV_GRAPH_PIPELINE.md +38 -0
docs/REALTIME_ENV_GRAPH_PIPELINE.md CHANGED
@@ -332,3 +332,41 @@ gwam_v12_sparse_v2/episodes/<split>/<task>/episode_XXXXXX.zip
332
  ```
333
 
334
  The offline loader reads already exported arrays and does not require RoboCasa/SAM2 at evaluation time. The online final-graph extractor is for users who need to generate the same kind of final graph from a live environment at every simulation step.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
332
  ```
333
 
334
  The offline loader reads already exported arrays and does not require RoboCasa/SAM2 at evaluation time. The online final-graph extractor is for users who need to generate the same kind of final graph from a live environment at every simulation step.
335
+
336
+ ## Multi-view RGB / graph alignment contract
337
+
338
+ For joint training, evaluation, and real-time inference, the model-facing online call is:
339
+
340
+ ```python
341
+ snapshot = extractor.extract_final_graph(visual_backend=visual_backend)
342
+ graph = snapshot["gnn_graph"] # x [N_real,342], edge_attr [E,8]
343
+ rgb_frames = snapshot["rgb_frames"] # dict: view_id -> uint8[256,256,3]
344
+ rgb_frame_cameras = snapshot["rgb_frame_cameras"] # ordered camera names for those view ids
345
+ ```
346
+
347
+ All fields in one `snapshot` are produced from the same current simulator state before the policy/env step advances:
348
+
349
+ ```text
350
+ current qpos/qvel/contact state
351
+ + current segmentation renders from the ordered camera list
352
+ + current RGB renders from the same ordered camera list
353
+ + current visible RLE masks indexed by (node slot n, view id v)
354
+ + SAM2 masked pooling on rgb_frames[v] using that same mask
355
+ = final graph x [N_real,342]
356
+ ```
357
+
358
+ The ordered multi-view camera contract is:
359
+
360
+ ```text
361
+ v=0 robot0_agentview_right
362
+ v=1 robot0_agentview_left
363
+ v=2 robot0_eye_in_hand
364
+ ```
365
+
366
+ Alignment rules for downstream integration:
367
+
368
+ - `view_visible[n,v]`, `view_centroid[n,v]`, `view_area[n,v]`, `view_bbox[n,v]`, `rle_masks[*]["v"]`, `visual_features_sparse["v"]`, and `rgb_frames[v]` use the same view id.
369
+ - `visual_features_sparse["n"]` uses the original padded node slot id; `gnn_graph["slot_ids"]` maps active GNN rows back to those padded slots.
370
+ - `rgb_frames[v]` is an upright `uint8[256,256,3]` RGB frame rendered with the same vertical flip convention as the segmentation/mask path.
371
+ - `save_realtime_graph_snapshot(snapshot, out_dir)` writes `rgb/view_<v>_<camera>.npy` plus `rgb_manifest.json`, so saved debug/eval snapshots contain graph data first and aligned RGB images alongside it.
372
+