dhyun22 commited on
Commit
a392c86
·
verified ·
1 Parent(s): c07a08a

README: .single.npz loader alignment + per-view canonical baked in data (no code change)

Browse files
Files changed (1) hide show
  1. README.md +43 -30
README.md CHANGED
@@ -52,26 +52,15 @@ cfg["model"]["config"]["net"].update(
52
  `pose_mode` stays `"vae_concat"` (pose is VAE-encoded and concatenated into `cond_embedder`; keep it). The
53
  `cond_embedder` in-channels auto-compute as `warped_latent(16) + visibility(1) + pose_latent(16)` — leave that.
54
 
55
- ### 1f. Plücker canonical frame = each view's OWN first frame (code change, `models/multiview_pose_model_rectified_flow.py`)
56
- Currently `_preprocess` (~line 185–189) uses **one** canonical frame — TARGET **view0 frame0** — applied to
57
- **all** views, for cross-view shared-space alignment:
58
- ```python
59
- c2w_ref = torch.linalg.inv(w2c_t[:, 0, 0]) # (B,4,4) <- view0 frame0, SHARED
60
- data_batch["plucker_map"] = self._plucker_from_w2c(w2c_t[:, :, idx], K, c2w_ref, src, h_lat, w_lat)
61
- ```
62
- For single-ego "own first frame" grounding, make the canonical **per-view** (view v grounded to ITS OWN
63
- frame0), so each view's rays are expressed relative to its own first camera pose:
64
- ```python
65
- # per-view canonical: view v -> inv(w2c_t[:, v, 0]); build plucker per view then stack
66
- maps = []
67
- for v in range(w2c_t.shape[1]):
68
- c2w_ref_v = torch.linalg.inv(w2c_t[:, v, 0]) # (B,4,4) own frame0
69
- maps.append(self._plucker_from_w2c(w2c_t[:, v:v+1, idx], K, c2w_ref_v, src, h_lat, w_lat))
70
- data_batch["plucker_map"] = torch.cat(maps, dim=2) # concat along the V*state_t token axis
71
- ```
72
- (Confirm the token axis/ordering matches how `_plucker_from_w2c` lays out `(B,6,V*state_t,h,w)` — it iterates
73
- views then frames. Drop the `reference_plucker_map` branch entirely since refs are off.) This removes the
74
- cross-view coupling from Plücker while keeping per-view camera grounding from the first frame.
75
 
76
  ### 1c. checkpoint = from scratch
77
  ```python
@@ -96,19 +85,43 @@ config with the flags above.
96
  emit_reference_pose=False` in the viz kwargs too, or the viz dataset build will look for refs that aren't there.
97
 
98
  --------------------------------------------------------------------------------
99
- ## 2. DATA you must regenerate (this is the real work — NOT in this code bundle)
100
 
101
- The training code just consumes `clip.npz` per view. For the single-ego setup you must rebuild the CoMind
102
- `clip.npz` so that:
 
103
 
104
- 1. **`warped_cond`** = warp into the target view using **only that view's OWN past frames** as the source pool.
105
- The current pipeline uses a **combined pool** (both views' past, max-coverage source selection). Change the
106
- source pool to per-view own-past only. (Depth + campose per view are already there.)
107
- 2. **`pose` / `pose_person`** = render **only the wearer's own** skeleton in each view (not the partner's).
108
- Currently `pose_person` renders both people identity-colored.
 
 
 
 
 
109
 
110
- Everything else in `clip.npz` (`target_rgb`, `visibility_packed`, per-view `campose`) stays. You do **not**
111
- need `refs_shared.npz` at all (no references).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
 
113
  --------------------------------------------------------------------------------
114
  ## 3. Things to know / gotchas
 
52
  `pose_mode` stays `"vae_concat"` (pose is VAE-encoded and concatenated into `cond_embedder`; keep it). The
53
  `cond_embedder` in-channels auto-compute as `warped_latent(16) + visibility(1) + pose_latent(16)` — leave that.
54
 
55
+ ### 1f. Plücker canonical frame = each view's OWN first frame — **already baked in the data, NO code change**
56
+ We want each view's Plücker rays expressed relative to its OWN first frame (not a shared cross-view frame).
57
+ **The `.single.npz` data already bakes this**: `L_w2c[0]` and `H_w2c[0]` are the identity matrix
58
+ (`cam_frame: per_view_canonical_frame0`), i.e. every view's camera poses are already canonicalized to its own
59
+ frame0. The model's existing `_preprocess` (~line 185) computes `c2w_ref = inv(w2c[:, 0, 0])`; since view0
60
+ frame0 is identity, `c2w_ref = I` and the shared transform is a **no-op**, so each view's rays come out in its
61
+ own already-canonical frame — exactly what we want. **Therefore: keep the model Plücker code AS-IS. Do NOT add
62
+ a per-view-canonical loop — the data already did it (adding one would be redundant).** Just keep
63
+ `enable_plucker=True`, `enable_reference_plucker=False`, and drop the `reference_plucker_map` branch (refs off).
 
 
 
 
 
 
 
 
 
 
 
64
 
65
  ### 1c. checkpoint = from scratch
66
  ```python
 
85
  emit_reference_pose=False` in the viz kwargs too, or the viz dataset build will look for refs that aren't there.
86
 
87
  --------------------------------------------------------------------------------
88
+ ## 2. DATA — the ablation clips are the sibling `.single.npz` (already being generated)
89
 
90
+ The single-ego ablation data is stored as a **sibling `<clip>.single.npz`** next to the untouched originals
91
+ (`<clip>.npz`, `.campose.npz`, `.refs.npz`). The `.single.npz` is **self-contained** for training and its keys
92
+ match the loader's existing convention. Contents (JPEG byte-arrays for image streams, same as the originals):
93
 
94
+ ```
95
+ L_/H_target GT video (JPEG) -> video
96
+ L_/H_warped OWN-only warp (srcview==0 kept; ==1 -> black hole) -> control_input_warped
97
+ L_/H_pose SELF-only skeleton (own hands only) -> control_input_pose
98
+ L_/H_vis_packed + vis_shape packed visibility (hole frames vis=False) -> control_input_visibility
99
+ L_/H_w2c (77,4,4) PER-VIEW canonical (each view frame0 = identity) -> camera_w2c
100
+ K_leader/K_helper (3,3) intrinsics -> camera_K
101
+ L_/H_srcf source frame idx (hole=-1) [loader ignores]
102
+ warp_mode/pose_mode/cam_frame/n_hole_* markers [loader ignores]
103
+ ```
104
 
105
+ **IMPORTANT — source strictly from `.single.npz`.** The original `clip.npz` ALSO has `L_warped/L_pose/
106
+ L_vis_packed`, but those are the OLD combined-pool warp + both-people pose. Read warped/pose/vis (and w2c/K)
107
+ **only from `.single.npz`**. Since `.single.npz` also carries `L_target`, the simplest wiring is to use
108
+ `.single.npz` as the sole source and not open `clip.npz` at all (keypoints aren't read by training). No
109
+ `.refs.npz` (references are off).
110
+
111
+ ### 2a. Loader adaptation (small — the format already matches)
112
+ Start from `datasets/comind_pairs.py` (`ComindActorActorDataset`), which already reads L_/H_ keys as JPEG
113
+ streams. Change:
114
+ - **Point the npz path at `<clip>.single.npz`** (and use it for the camera reads too — it has `L_w2c`/
115
+ `K_leader`). Drop the `.refs.npz` requirement in the eligibility loop and don't open refs.
116
+ - **`person_pose=False`** — `.single.npz` has `L_pose` (self-only), NOT `L_pose_person`; with
117
+ `person_pose=True` the loader would KeyError.
118
+ - **`num_reference_frames=0`** (R=0) so the reference block is skipped.
119
+ - Everything else is unchanged: `_stack_jpeg` decode, `np.unpackbits(vis_packed)` with `vis_shape=(77,504,504)`,
120
+ `_fit_poses(w2c,(77))`, `_resize` to your train resolution — all already match the `.single.npz` layout.
121
+
122
+ Verified against a real file (`62531cc1_006159.single.npz`, 28.5MB): warped/pose/target are JPEG object arrays;
123
+ `vis_shape=(77,504,504)` with packed-bit capacity exactly `77*504*504`; `L_w2c[0]==H_w2c[0]==identity`
124
+ (per-view canonical). So with the three config flips above, the existing loader/decoder path lines up 1:1.
125
 
126
  --------------------------------------------------------------------------------
127
  ## 3. Things to know / gotchas