feat(zarr): persist camera intrinsics in zarr.json#386
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
66a49fd to
f058830
Compare
5265946 to
fb7e066
Compare
c73430a to
75a9774
Compare
75a9774 to
5f26d41
Compare
fb7e066 to
1c23942
Compare
d70ad6c to
e84a5e9
Compare
…odiments
Squashed combining the intrinsics/embodiment work:
- move intrinsics/extrinsics into embodiment classes (remove CameraTransforms)
- gaze viz mode + zarr_data_viz notebook update; add LightWheel embodiment
- persist camera intrinsics in zarr.json; make them MANDATORY (validated {camera_key: 3x4} dict)
- collapse aria/mecka/scale/lightwheel human data into human_* (ids 1-3); eva = 4-6
- strict extrinsics (None or non-empty dict); embodiment validated at write time
- aria right-hand ee-pose + wrist-pose orientation fix
- sweep all hydra configs + tests to the collapsed embodiment
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… head-frame overlays
Drop RIGHT_HAND_ORIENTATION_FIX (ee, diag(-1,-1,1) X/Y) and RIGHT_WRIST_ORIENTATION_FIX (wrist, diag(-1,1,-1) X/Z) so the right hand uses T_ROT_CAM like the left. Verified in dataset viz: both hands share one convention after revert. Intrinsics + human_bimanual kept.
e84a5e9 to
e6dcf42
Compare
- pi.py / pl_data_utils.py: control_mode is declared per-embodiment in yaml only — remove the dead "aria" fallback and the silent gripper default; an embodiment with no matching key now raises ValueError. - zarr_dataset_multi.py: precomputed norm_stats.json missing the requested embodiment id now raises ValueError instead of silently loading empty stats (enum ids were renumbered by the collapse). - zarr_writer.py: actually enforce the documented intrinsics/extrinsics contract — each intrinsics value must be 3x4, each extrinsics value 4x4; fix stale CONTRIBUTING_DATA.md section refs (§8->§9, §5.4->§6.4/§6.3). - notebooks: replace imports of deleted egomimicUtils names (CameraTransforms/INTRINSICS) with the relocated constants in rldb/embodiment (ARIA_/SCALE_/MECKA_INTRINSICS, Eva.EXTRINSICS). - aria_utils.py: delete the dead RIGHT_HAND/RIGHT_WRIST_ORIENTATION_FIX constants and their stale rationale (usages were reverted in e6dcf42). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TYmG3nhxt7LYiaaSJPsKEV
ffbbf5b to
7066428
Compare
…lapse data (audit B5/B1) B5: the changelog claimed the right-hand orientation fix is applied, but commit e6dcf42 reverts it. Describe the actual convention (both aria hands share one T_ROT_CAM convention; the per-hand fix was reverted as unnecessary). B1: get_embodiment_id has no alias for legacy vendor strings, so a locally cached pre-collapse episode (attrs embodiment='aria_bimanual' etc.) hard-crashes with KeyError on load. Rather than add an alias, the changelog now tells users to delete their local cache and re-download the reprocessed (human_*) episodes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TYmG3nhxt7LYiaaSJPsKEV
7066428 to
d052953
Compare
…gration) Prepares for the deferred SQL migration: all data-config filter lambdas and csv_uploader now select on the collapsed embodiment value 'human_bimanual' instead of the legacy 'aria_bimanual'. 9 configs + csv_uploader, matching cotrain_pi_latent which was already human_bimanual. COORDINATION: these filters now match zero rows until the SQL embodiment/ robot_name column is renamed to human_bimanual — land this together with the SQL migration (see human.yaml note). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TYmG3nhxt7LYiaaSJPsKEV
#508 dropped the robot_name column from the DB (only embodiment remains) but left many filters + code still referencing row['robot_name'] -> KeyError at filter time. Point everything at embodiment: - 6 filter lambdas (cotrain_pi_lang, cotrain_pi_no_lang, eva_pi_lang, human, scale_pi): row['robot_name'] -> row['embodiment']. - scale_pi also: 'scale_bimanual' -> 'human_bimanual' (value collapsed; the existing lab=='scale' clause still isolates the source). - aria_keypoints, aria_keypoints_wrist, industry_eva_pi(eva): converted plain {robot_name/embodiment, task} dict filters -> DatasetFilter+filter_lambdas on embodiment (plain-dict filters are also rejected by the zarr resolver). - latent_dataset.build_dataset: constructed filter -> row['embodiment']. - csv_uploader: dropped the orphaned robot_name write (embodiment already set; TableRow has no robot_name field so it would raise). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TYmG3nhxt7LYiaaSJPsKEV
Claude Code ReviewSummaryMassive PR that combines three orthogonal changes: (1) the advertised feature — persisting camera intrinsics in Key concerns1. PR scope mismatch — this is not a single-feature PRThe title says "persist camera intrinsics in zarr.json" but the diff also:
Each of these deserves its own PR + review. Please split. 2. Embodiment integer id renumbering is a silent data-corruption riskOld 3. SQL migration is assumed but not included
Related: the README changelog tells users to re-download data, but there's no migration path for the DB itself, and 4. Intrinsics contract is stricter than the codebase can honor today
5. Judgment calls buried in configs
6.
|

Add an intrinsics parameter to ZarrWriter (and create_and_write) that
serializes a single np.ndarray K matrix or a {camera_key: K} dict into
zarr metadata. Expose ZarrEpisode.intrinsics / ZarrDataset.intrinsics
that read it back as ndarray(s), or None when not written.
This unblocks per-episode intrinsics so viz no longer has to rely on
class-level Embodiment.INTRINSICS constants.