ChangChrisLiu commited on
Commit
2dcb074
·
verified ·
1 Parent(s): ad9537f

Remove duplicated release-prefix root mirror files

Browse files
Files changed (1) hide show
  1. gwam_v12_sparse_v2/SCHEMA.md +0 -293
gwam_v12_sparse_v2/SCHEMA.md DELETED
@@ -1,293 +0,0 @@
1
- # GWAM_Data v1.2 sparse-v2 schema
2
-
3
- This file is normative for the current GWAM_Data v1.2 sparse-v2 export.
4
-
5
- Old v1/v1.1 notes mentioning dense `rel_state`, dense visual tensors, `distractor` family index 1, or 317/323-D `node_feats` are historical only and must not be used to build v1.2 loaders.
6
-
7
- ## Episode layout
8
-
9
- ```text
10
- <split>/<task>/episode_000123/
11
- _PHASE1_DONE.json
12
- graph/
13
- frames.jsonl
14
- graph_static.json
15
- node_state.npz
16
- view_evidence.npz
17
- dynamic_edges.jsonl
18
- visible_masks_rle.jsonl.gz
19
- visual_features_sparse.npz # Phase 2 sparse visible-only features
20
- audit/
21
- summary.json # Phase 1 audit summary
22
- phase2_summary.json # Phase 2 audit summary
23
- ```
24
-
25
- Per-episode ZIPs should preserve the `<split>/<task>/episode_xxxxxx/` prefix.
26
-
27
- ## Phase 1 tensors
28
-
29
- ```text
30
- graph/node_state.npz
31
- node_state: float32[T, 256, 32]
32
- node_state_schema: str[32]
33
- ```
34
-
35
- The `node_state_schema` array inside the npz is authoritative. Padded rows are all-zero; loaders must gate on the active channel before using any other field.
36
-
37
- Current v2 family ids:
38
-
39
- ```text
40
- 0 object, including distractors
41
- 1 reserved / forbidden old distractor id
42
- 2 surface
43
- 3 receptacle
44
- 4 fixture
45
- 5 articulated_part
46
- 6 handle
47
- 7 control, defined but unpopulated in current export
48
- 8 region, defined but unpopulated in current export
49
- 9 robot
50
- ```
51
-
52
- There is no target-relevance family bit in v2.
53
-
54
- ## Static graph
55
-
56
- ```text
57
- graph/graph_static.json
58
- ```
59
-
60
- Contains deterministic node inventory, schema/rule-version stamps, source metadata, and supervision-only goal metadata. The goal/instruction/object-role block is not a model-input tensor.
61
-
62
- Required schema stamp:
63
-
64
- ```text
65
- GWAM_Data_v1.2_phase1_sparse_v2
66
- ```
67
-
68
- All packaged episodes should share one identical `rule_versions` blob.
69
-
70
- ## View evidence and masks
71
-
72
- ```text
73
- graph/view_evidence.npz
74
- graph/visible_masks_rle.jsonl.gz
75
- ```
76
-
77
- Mask contract:
78
-
79
- ```text
80
- views: side_right, side_left, wrist
81
- side_right -> robot0_agentview_right
82
- side_left -> robot0_agentview_left
83
- wrist -> robot0_eye_in_hand
84
- min_visible_px: 20
85
- RLE: row-major binary RLE v2_vectorized
86
- resolution: 256x256
87
- ```
88
-
89
- RLE masks and `view_evidence` visible pairs must agree exactly.
90
-
91
- ## Dynamic edges
92
-
93
- ```text
94
- graph/dynamic_edges.jsonl
95
- ```
96
-
97
- Current sparse-v2 event vocabulary:
98
-
99
- ```text
100
- contact
101
- visibility_change
102
- ```
103
-
104
- There is no dense `rel_state[T,N,N,C]` tensor in v1.2 sparse-v2.
105
-
106
- ## Phase 2 sparse visual features
107
-
108
- Phase 2 uses the Phase 1 visible masks and writes sparse features only for visible node/view pairs.
109
-
110
- Required invariants:
111
-
112
- ```text
113
- no invisible features
114
- valid_pairs union invalid_pairs == Phase 1 visible pairs
115
- valid_pairs intersect invalid_pairs == empty
116
- no duplicate pairs
117
- valid feature vectors are fp16 and unit-normalized
118
- type text vectors are deterministic across episodes
119
- ```
120
-
121
- Phase 2 writes:
122
-
123
- ```text
124
- graph/visual_features_sparse.npz
125
- t int32[P], n int16[P], v int8[P]
126
- valid sparse pair indices: frame, node, view
127
- feat float16[P, 256]
128
- unit-normalized visible-only visual features
129
- type_clip32 float32[256, 32]
130
- per-node-slot projected CLIP text type vectors
131
- invalid_t, invalid_n, invalid_v
132
- visible Phase-1 pairs where feature extraction failed
133
- visual_computed bool[T]
134
- per-frame Phase-2 coverage flag
135
- cameras str[3]
136
- view names
137
- n_max int32[1]
138
- fixed node cap, 256
139
-
140
- audit/phase2_summary.json
141
- Phase 2 audit counts and visible-pair partition summary.
142
- ```
143
-
144
- Do not expect dense `[T,N,V,D]` tensors.
145
-
146
- ## Model-input discipline
147
-
148
- Allowed default model input:
149
-
150
- ```text
151
- node_state active rows
152
- sparse dynamic_edges
153
- Phase 2 visible-only features and their pair indices
154
- robot/action streams if explicitly included by experiment
155
- ```
156
-
157
- Supervision/metadata only unless explicitly allowed:
158
-
159
- ```text
160
- instruction
161
- fixture_refs
162
- object_roles
163
- goal metadata
164
- node_id strings
165
- source strings
166
- frames.jsonl timestamp/index/next.done alignment fields
167
- ```
168
-
169
- Do not use raw node slot position as a semantic cue; node ordering can correlate with task-object ordering.
170
-
171
-
172
- ## Live real-time environment graph compatibility
173
-
174
- The on-disk release stores full episodes, while the real-time extractor returns one current simulator frame at a time. They use the same schema vocabulary:
175
-
176
- ```text
177
- on-disk episode: node_state float32[T,256,32]
178
- live current frame: node_state float32[256,32]
179
- live K-frame buffer: node_state float32[K,256,32]
180
- ```
181
-
182
- The live extractor in `realtime/gwam_realtime_env_graph.py` / `extractors/gwam_realtime_env_graph.py` uses the same:
183
-
184
- ```text
185
- node_state_schema
186
- family ids
187
- active-mask policy
188
- static prior edge labels: part_of, controls
189
- dynamic edge labels: contact, visibility_change
190
- view_evidence fields and normalized [0,1] units
191
- row-major RLE mask codec when masks are requested
192
- ```
193
-
194
- Real-time extraction is for users with their own RoboCasa/robosuite environment and assets. It constructs a current-observed graph from the current simulator state and segmentation renders. It does not compute the offline Phase-2 SAM2/CLIP `visual_features_sparse.npz` by default. Future simulator states, future robot nodes, future contacts, goal-derived target-node ids, object role labels, and instruction-derived target edges are not default-safe evaluation inputs; use them only in explicitly labeled oracle or teacher-forced modes.
195
-
196
- ## Known limitations
197
-
198
- 1. `target/OpenDrawer/episode_000459` is dropped because source env initialization failed repeatedly.
199
- 2. Six target tasks are state-blind in `node_state`: CloseFridge, OpenStandMixerHead, SlideDishwasherRack, TurnOffStove, TurnOnElectricKettle, TurnOnMicrowave. Use a future `fixture_state.npz` sidecar or document these as geometric/contact/visibility-supervised only.
200
- 3. `control` and `region` family ids are defined but unpopulated in the current export.
201
- 4. `N_MAX=256`; max observed node count is close to the cap.
202
-
203
- ## Normative codec, unit, and feature provenance addendum
204
-
205
- ### Frame/action alignment
206
-
207
- `frames.jsonl` maps graph timestep `t` to source `source_frame` 1:1 with no subsampling. RoboCasa LeRobot metadata records 20 Hz (`record_frequency=20.0`), so frame timestamps advance by 0.05 s. For the PandaOmron source episodes, `meta/modality.json` describes the 12-D action layout as `base_motion[0:4]`, `control_mode[4:5]`, `end_effector_position[5:8]`, `end_effector_rotation[8:11]`, and `gripper_close[11:12]`.
208
-
209
- ### `view_evidence.npz` units
210
-
211
- All image-space values are normalized to [0,1] in the 256x256 upright image frame: `view_centroid=(mean_col/256, mean_row/256)`, `view_area=pixels/(256*256)`, and `view_bbox=[x_min,y_min,x_max,y_max]/256` from inclusive pixel bounds. Camera intrinsics/extrinsics are not exported; both agentview cameras move with the mobile base and the wrist camera moves with the hand.
212
-
213
- ### `visible_masks_rle.jsonl.gz` codec
214
-
215
- Rows are gzipped JSONL records of the form `{"t": int, "masks": [{"n": int, "v": int, "area_px": int, "bbox": [x_min,y_min,x_max,y_max], "rle": [runs...]}]}`. Frames with zero visible pairs are omitted. The mask is 256x256, flattened row-major from the upright image, and `rle` is alternating run lengths starting with the background/zero run; runs sum to 65,536.
216
-
217
- ### Phase-2 visual features
218
-
219
- `feat` is a 256-D float16 SAM2.1 `hiera_base_plus` image-encoder feature pooled under the Phase-1 visible RLE mask on the source LeRobot RGB frame, then L2-normalized. `invalid_t/n/v` lists Phase-1 visible pairs that had no support after downsampling to the SAM2 embedding grid; no feature is fabricated. `type_clip32` is a 32-D CLIP ViT-B/32 category-text feature generated with prompt `a photo of a {category_text} in a kitchen.`, projected by seeded Gaussian random projection seed 20260702 and L2-normalized. Padded node slots are not zero in `type_clip32`; always gate on `node_state[..., active]` before consuming it.
220
-
221
- Note: padded node slots are not zero in `type_clip32`; active gating is mandatory for `type_clip32` as well as `node_state`.
222
-
223
- ## Structured model representation addendum
224
-
225
- Node tensor:
226
-
227
- ```text
228
- node_state: float32[T,256,32]
229
- active_mask: bool[T,256] = node_state[...,0] == 1
230
- ```
231
-
232
- Node-state typed channel groups:
233
-
234
- ```text
235
- 0 active: binary mask
236
- 1 family_idx: categorical id 0..9
237
- 2:4 static flags: free_movable, articulated
238
- 4:11 pose: xyz + quat_xyzw
239
- 11:17 velocity: linear xyz + angular xyz
240
- 17:19 scalar joint state: qpos, qvel
241
- 19:22 visibility flags: right, left, wrist
242
- 22:32 reserved zeros
243
- ```
244
-
245
- Static/prior edge tensors derived from `graph_static.json/prior_edges`:
246
-
247
- ```text
248
- prior_edge_index: int64[2,E_prior]
249
- prior_edge_type: int64[E_prior] where part_of=0, controls=1
250
- prior_edge_attr_onehot: float32[E_prior,2] optional
251
- ```
252
-
253
- Dynamic/event edge tensors derived per JSONL row from `dynamic_edges.jsonl`:
254
-
255
- ```text
256
- dyn_edge_index[t]: int64[2,E_dyn_t]
257
- dyn_edge_type[t]: int64[E_dyn_t] where contact=0, visibility_change=1
258
- dyn_edge_attr[t]: optional concat(rel_onehot[2], view_onehot[3], is_self_edge[1])
259
- ```
260
-
261
- `contact` edges are stored as sorted node pairs and are physically undirected; add reverse edges explicitly for bidirectional message passing. `visibility_change` edges are self-edges with a required `view` id. No force/normal/contact-point feature is stored.
262
-
263
- Static node records (`node_id`, `category_text`, `root_bodies`, `source`) are metadata; do not use string ids/source paths as default model inputs. `type_clip32[256,32]` is an optional category-text node feature and must be active-gated because padded slots are non-zero.
264
-
265
-
266
- ## Online final-graph extraction files
267
-
268
- The public real-time inference/evaluation path can construct the full final graph for one current simulator step:
269
-
270
- ```text
271
- extract_final_graph(visual_backend=Sam2ClipRealtimeFeatureBackend(...))
272
- current env state/RGB/segmentation/masks + Phase 1 graph + Phase 2 SAM2/CLIP = x [N_real,342]
273
- ```
274
-
275
- Bundled direct-run files:
276
-
277
- ```text
278
- realtime/gwam_realtime_env_graph.py
279
- examples/realtime_env_graph_eval_loop.py
280
- scripts/setup_realtime_final_graph_env.sh
281
- scripts/verify_realtime_final_graph.py
282
- models/sam2/checkpoints/sam2.1_hiera_base_plus.pt
283
- models/clip/ViT-B-32.pt
284
- models/MODEL_MANIFEST.json
285
- ```
286
-
287
- The default online final graph feature layout is:
288
-
289
- ```text
290
- 20 state dims + 10 family one-hot + 256 SAM2 masked pooled visual + 32 type_clip32 + 24 view evidence = 342
291
- ```
292
-
293
- `extract_current_graph()` is a lightweight Phase-1/debug path only and is not the final model-input graph.