Download scale/script/summarize_simple_text.py from Tinghong-Ye22/code-Movens-Zero_train: direct link, hf CLI and curl.
- Browser
- Download file 2.13 kB
-
https://huggingface.co/Tinghong-Ye22/code-Movens-Zero_train/resolve/main/scale/script/summarize_simple_text.py
- Command line
-
hf download hf://Tinghong-Ye22/code-Movens-Zero_train/scale/script/summarize_simple_text.py
-
curl -L -o summarize_simple_text.py https://huggingface.co/Tinghong-Ye22/code-Movens-Zero_train/resolve/main/scale/script/summarize_simple_text.py
2.13 kB
| """Preserve a small diagnostic snapshot; not benchmark/scaling metrics.""" | |
| import json | |
| from pathlib import Path | |
| import shutil | |
| import sys | |
| import numpy as np | |
| ROOT=Path(__file__).resolve().parents[2] | |
| sys.path.insert(0,str(ROOT/'scale/script')) | |
| from preview_scale import save | |
| def main(): | |
| base=ROOT/'scale/groups/sml_1m_224_a1e-4_o1e-5_nojerk/previews/auto_simple_text' | |
| target=ROOT/'scale/audits/reference_20261002/simple_text_snapshot' | |
| state=json.loads((base/'web/status.json').read_text()) | |
| if len(state['models'])!=3:raise RuntimeError('Wait for all three models') | |
| rows=[] | |
| for model in state['models']: | |
| for case in model['cases']: | |
| source=(base/'web'/case['video']).resolve(strict=True).parent | |
| dest=target/model['size']/case['id'];dest.mkdir(parents=True,exist_ok=True) | |
| for name in ('gt.npz','prediction.npz','status.json','selection_record.json','comparison.mp4'): | |
| if (dest/name).exists():raise FileExistsError('Do not overwrite the first diagnostic snapshot') | |
| shutil.copy2(source/name,dest/name) | |
| with np.load(dest/'prediction.npz') as p,np.load(dest/'gt.npz') as g: | |
| pred,gt=p['qpos_36'],g['qpos_36'];assert pred.shape==gt.shape | |
| ratio=np.std(pred[1:,7:],axis=0).mean()/np.std(gt[1:,7:],axis=0).mean() | |
| row=dict(size=model['size'],step=model['step'],case=case['id'], | |
| joint_temporal_std_ratio=float(ratio), | |
| root_displacement_m=float(np.linalg.norm(pred[-1,:3]-pred[0,:3])), | |
| gt_root_displacement_m=float(np.linalg.norm(gt[-1,:3]-gt[0,:3])), | |
| root_height_range_m=float(np.ptp(pred[:,2])),gt_root_height_range_m=float(np.ptp(gt[:,2])), | |
| root_rmse_m=float(np.sqrt(np.mean(np.sum((pred[1:,:3]-gt[1:,:3])**2,axis=1)))), | |
| video=str((dest/'comparison.mp4').relative_to(target.parent))) | |
| rows.append(row) | |
| save(target.parent/'simple_text_measurements.json',rows) | |
| print(json.dumps(rows,ensure_ascii=False,indent=2)) | |
| if __name__=='__main__':main() | |