Files
hand-motion-pipeline/scripts/render_corrected_dynhamr_rgbd.py
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

16 lines
1.5 KiB
Python

import os,subprocess,sys,shutil
from pathlib import Path
ROOT=Path(__file__).resolve().parents[1]; dyn=ROOT/'third_party/Dyn-HaMR'; base=ROOT/'output/20260915_171525_dynhamr'
env=os.environ.copy();env.update(TORCH_HOME=str(ROOT/'.torch_cache'),HF_HOME=str(ROOT/'.hf_cache'),HF_HUB_OFFLINE='1',TRANSFORMERS_OFFLINE='1',PYOPENGL_PLATFORM='egl',LD_LIBRARY_PATH='',MPLCONFIGDIR='/tmp/matplotlib-dynhamr',HYDRA_FULL_ERROR='1')
env['DYNHAMR_HIDE_CAMERA_MARKERS']='1'
env['PATH']=str(dyn/'.dynhamr/bin')+':'+env['PATH'];env['PYTHONPATH']=':'.join(str(dyn/p) for p in ['dyn-hamr','third-party/hamer','third-party/hamer/third-party/ViTPose'])
target=base/('raw_comparison' if '--raw' in sys.argv else 'corrected')
if '--raw' in sys.argv:
(target/'prior').mkdir(parents=True,exist_ok=True)
shutil.copy2(base/'optimization/prior/20260915_171525_000000_world_results.npz',target/'prior/20260915_171525_000000_world_results.npz')
cmd=[str(dyn/'.dynhamr/bin/python'),'-u','run_opt.py','data=video_vipe','data.root='+str(base/'dataset'),'data.seq="20260915_171525"','data.vipe_dir='+str(base/'rgbd_cameras'),'data.frame_opts.fps=30','run_opt=False','run_vis=True','temporal_smooth=False','vis.phases=[prior]','hydra.run.dir='+str(base/'corrected')]
cmd[-1]='hydra.run.dir='+str(target)
cmd+=['vis.overwrite=True']
with (target/'render.log').open('w') as f:r=subprocess.run(cmd,cwd=dyn/'dyn-hamr',env=env,stdout=f,stderr=subprocess.STDOUT)
(target/'render_exit.txt').write_text(str(r.returncode));raise SystemExit(r.returncode)