Remove duplicated release-prefix root mirror files
Browse files
gwam_v12_sparse_v2/examples/REALTIME_ENV_GRAPH_README.md
DELETED
|
@@ -1,90 +0,0 @@
|
|
| 1 |
-
# GWAM real-time final graph example
|
| 2 |
-
|
| 3 |
-
Run this only in an environment with RoboCasa/robosuite, SAM2.1, CLIP, and the task assets available.
|
| 4 |
-
|
| 5 |
-
Real final graph path:
|
| 6 |
-
|
| 7 |
-
```bash
|
| 8 |
-
MUJOCO_GL=egl PYOPENGL_PLATFORM=egl \
|
| 9 |
-
python examples/realtime_env_graph_eval_loop.py \
|
| 10 |
-
--task OpenDrawer \
|
| 11 |
-
--robots PandaOmron \
|
| 12 |
-
--steps 2 \
|
| 13 |
-
--visual-backend sam2 \
|
| 14 |
-
--device cuda \
|
| 15 |
-
--json-output /tmp/gwam_realtime_final_graph.json
|
| 16 |
-
```
|
| 17 |
-
|
| 18 |
-
The script calls:
|
| 19 |
-
|
| 20 |
-
```python
|
| 21 |
-
snapshot = extractor.extract_final_graph(visual_backend=visual_backend)
|
| 22 |
-
graph = snapshot["gnn_graph"]
|
| 23 |
-
```
|
| 24 |
-
|
| 25 |
-
Expected final-graph invariant:
|
| 26 |
-
|
| 27 |
-
```text
|
| 28 |
-
D_node = 342
|
| 29 |
-
```
|
| 30 |
-
|
| 31 |
-
Optional debug snapshot output:
|
| 32 |
-
|
| 33 |
-
```bash
|
| 34 |
-
python examples/realtime_env_graph_eval_loop.py \
|
| 35 |
-
--task OpenDrawer \
|
| 36 |
-
--steps 1 \
|
| 37 |
-
--visual-backend sam2 \
|
| 38 |
-
--save-dir /tmp/gwam_realtime_debug \
|
| 39 |
-
--json-output /tmp/gwam_realtime_debug/summary.json
|
| 40 |
-
```
|
| 41 |
-
|
| 42 |
-
For CI/docs smoke only, `--visual-backend fake` checks wiring and 342-D shape without SAM2/CLIP. Do not report benchmark metrics from the fake backend.
|
| 43 |
-
|
| 44 |
-
`--phase1-only-debug` returns the lightweight 33-D Phase-1 graph and is not the final model graph.
|
| 45 |
-
|
| 46 |
-
## Multi-view RGB / graph alignment contract
|
| 47 |
-
|
| 48 |
-
For joint training, evaluation, and real-time inference, the model-facing online call is:
|
| 49 |
-
|
| 50 |
-
```python
|
| 51 |
-
snapshot = extractor.extract_final_graph(visual_backend=visual_backend)
|
| 52 |
-
graph = snapshot["gnn_graph"] # x [N_real,342], edge_attr [E,8]
|
| 53 |
-
rgb_frames = snapshot["rgb_frames"] # dict: view_id -> uint8[256,256,3]
|
| 54 |
-
rgb_frame_cameras = snapshot["rgb_frame_cameras"] # ordered camera names for those view ids
|
| 55 |
-
```
|
| 56 |
-
|
| 57 |
-
All fields in one `snapshot` are produced from the same current simulator state before the policy/env step advances:
|
| 58 |
-
|
| 59 |
-
```text
|
| 60 |
-
current qpos/qvel/contact state
|
| 61 |
-
+ current segmentation renders from the ordered camera list
|
| 62 |
-
+ current RGB renders from the same ordered camera list
|
| 63 |
-
+ current visible RLE masks indexed by (node slot n, view id v)
|
| 64 |
-
+ SAM2 masked pooling on rgb_frames[v] using that same mask
|
| 65 |
-
= final graph x [N_real,342]
|
| 66 |
-
```
|
| 67 |
-
|
| 68 |
-
The ordered multi-view camera contract is:
|
| 69 |
-
|
| 70 |
-
```text
|
| 71 |
-
v=0 robot0_agentview_right
|
| 72 |
-
v=1 robot0_agentview_left
|
| 73 |
-
v=2 robot0_eye_in_hand
|
| 74 |
-
```
|
| 75 |
-
|
| 76 |
-
Alignment rules for downstream integration:
|
| 77 |
-
|
| 78 |
-
- `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.
|
| 79 |
-
- `visual_features_sparse["n"]` uses the original padded node slot id; `gnn_graph["slot_ids"]` maps active GNN rows back to those padded slots.
|
| 80 |
-
- `rgb_frames[v]` is an upright `uint8[256,256,3]` RGB frame rendered with the same vertical flip convention as the segmentation/mask path.
|
| 81 |
-
- `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.
|
| 82 |
-
|
| 83 |
-
Reusable alignment verifier:
|
| 84 |
-
|
| 85 |
-
```bash
|
| 86 |
-
MUJOCO_GL=egl PYOPENGL_PLATFORM=egl python scripts/verify_rgb_graph_alignment.py
|
| 87 |
-
```
|
| 88 |
-
|
| 89 |
-
This verifier checks that one `extract_final_graph()` call does not advance simulator state, that re-rendered current RGB and segmentation/masks match the snapshot, that sparse visual features are reproducible from returned `rgb_frames[v]` and masks, and that saved `rgb_manifest.json`/RGB files round-trip.
|
| 90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|