Files
liyang ae28d55f81 Update to 2026-09-17 pipeline snapshot; add weights, L20 assets and recording via Git LFS
Source: RGB-D -> Dyn-HaMR -> L20 retargeting -> FoundationPose -> reference repair -> SPIDER,
documented in docs/PIPELINE_LATEST.md and docs/SETUP_AND_WEIGHTS.md. Adds FoundationPose and
nvdiffrast upstream snapshots, requirements/pipeline_venv.txt and the FoundationPose weight
manifest/downloader.

Assets (Git LFS): weights/ (WiLoR detector, HandFlow denoiser, UniDepth-L), FoundationPose
checkpoints, HaMeR checkpoint, Dyn-HaMR HMP model and BMC constraints, L20 URDF/meshes, the
20260915_171525 D405 recording and the two box CADs. MANO models are not redistributed
(third_party/hamer/_DATA/data/mano/README.txt). Environments, caches and run outputs excluded.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 11:43:37 +08:00

21 lines
1.4 KiB
Python

"""Restore mirrored-right inference to left-hand geometry in the original world."""
from pathlib import Path
import numpy as np
from scipy.spatial.transform import Rotation
ROOT=Path(__file__).resolve().parents[1];BASE=ROOT/'output/20260915_171525'
src=BASE/'handflow_left_mirrored';out=BASE/'handflow_left';out.mkdir(exist_ok=True)
M=np.diag([-1.,1.,1.]);M4=np.diag([-1.,1.,1.,1.])
h=dict(np.load(src/'handflow_results.npz'));j=dict(np.load(src/'human_joints.npz'))
for k in ['verts_cam','verts_world','trans']:h[k]=h[k]@M
h['c2w']=M4@h['c2w']@M4
h['pose']=h['pose'].copy();h['pose'][:,:3]=Rotation.from_matrix(M@Rotation.from_rotvec(h['pose'][:,:3]).as_matrix()@M).as_rotvec()
h['intrinsics']=h['intrinsics'].copy();h['intrinsics'][2]=848-1-h['intrinsics'][2]
h['side']='left';h['source']=str(ROOT/'docs/20260915_171525/color.mp4')
h['convention_note']='Canonical right prediction from mirrored video, geometry reflected into actual left camera/world; body-pose fields remain canonical and are not native MANO-left parameters.'
for k in ['joints','joints_raw','joints_world_raw','wrist_world','wrist_world_raw']:
if k in j:j[k]=j[k]@M
j['root_orient']=Rotation.from_matrix(M@Rotation.from_rotvec(j['root_orient']).as_matrix()@M).as_rotvec()
j['source']=str(out/'handflow_results.npz');j['side']='left'
np.savez_compressed(out/'handflow_results.npz',**h);np.savez_compressed(out/'human_joints.npz',**j)
print('Unmirrored left geometry',len(j['joints']))