backup H100 jiayin: pipeline_rigid, pipeline_runs, upvg
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- pipeline_rigid/00_config/paths.yaml +17 -0
- pipeline_rigid/01_ovow_mesh_6dof/build_scene.py +214 -0
- pipeline_rigid/02_raf_particles/particleize.py +73 -0
- pipeline_rigid/03_vipe_flow/run_vipe.py +60 -0
- pipeline_rigid/04_psivg_sim/run_rigid_sim.py +197 -0
- pipeline_rigid/05_projection_flow/project_particles.py +76 -0
- pipeline_rigid/06_conservation/conservation.py +123 -0
- pipeline_rigid/07_render_video/render_video.py +139 -0
- pipeline_rigid/__pycache__/chain_common.cpython-311.pyc +0 -0
- pipeline_rigid/chain_common.py +152 -0
- pipeline_rigid/run_pipeline.py +93 -0
- pipeline_runs/rigid_v1/conservation.json +19 -0
- pipeline_runs/rigid_v1/conservation.npz +3 -0
- pipeline_runs/rigid_v1/flow_status.json +7 -0
- pipeline_runs/rigid_v1/particles/domino_01.npz +3 -0
- pipeline_runs/rigid_v1/particles/domino_02.npz +3 -0
- pipeline_runs/rigid_v1/particles/domino_03.npz +3 -0
- pipeline_runs/rigid_v1/particles/domino_04.npz +3 -0
- pipeline_runs/rigid_v1/particles/domino_05.npz +3 -0
- pipeline_runs/rigid_v1/particles/domino_06.npz +3 -0
- pipeline_runs/rigid_v1/particles/domino_07.npz +3 -0
- pipeline_runs/rigid_v1/particles/domino_08.npz +3 -0
- pipeline_runs/rigid_v1/particles/domino_09.npz +3 -0
- pipeline_runs/rigid_v1/particles/domino_10.npz +3 -0
- pipeline_runs/rigid_v1/particles/domino_11.npz +3 -0
- pipeline_runs/rigid_v1/particles/domino_12.npz +3 -0
- pipeline_runs/rigid_v1/particles/domino_13.npz +3 -0
- pipeline_runs/rigid_v1/particles/domino_14.npz +3 -0
- pipeline_runs/rigid_v1/particles/domino_15.npz +3 -0
- pipeline_runs/rigid_v1/particles/domino_16.npz +3 -0
- pipeline_runs/rigid_v1/particles/domino_17.npz +3 -0
- pipeline_runs/rigid_v1/particles/hand_01.npz +3 -0
- pipeline_runs/rigid_v1/particles/index.json +102 -0
- pipeline_runs/rigid_v1/particles/table_01.npz +3 -0
- pipeline_runs/rigid_v1/preview.png +3 -0
- pipeline_runs/rigid_v1/projected.npz +3 -0
- pipeline_runs/rigid_v1/projection_meta.json +10 -0
- pipeline_runs/rigid_v1/rigid_domino_sim.mp4 +3 -0
- pipeline_runs/rigid_v1/run_manifest.json +13 -0
- pipeline_runs/rigid_v1/scene.json +0 -0
- pipeline_runs/rigid_v1/sim.npz +3 -0
- pipeline_runs/rigid_v1/sim_meta.json +352 -0
- upvg/exp2_out/ctrl_field.mp4 +3 -0
- upvg/exp2_out/first_frame.png +3 -0
- upvg/exp2_out/flow_frames/f000.png +3 -0
- upvg/exp2_out/flow_frames/f001.png +3 -0
- upvg/exp2_out/flow_frames/f002.png +3 -0
- upvg/exp2_out/flow_frames/f003.png +3 -0
- upvg/exp2_out/flow_frames/f004.png +3 -0
- upvg/exp2_out/flow_frames/f005.png +3 -0
pipeline_rigid/00_config/paths.yaml
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# rigid 链路径配置(H100 共享盘)
|
| 2 |
+
# 所有条目都指向"论文原代码"的实际位置,pipeline 只做编排,不改算法。
|
| 3 |
+
|
| 4 |
+
ovow:
|
| 5 |
+
root: /mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW
|
| 6 |
+
# 已跑完的 EgoDex 骨牌 case(含 objects/*/mid_files/scaled_mesh.obj + pose_result/poses.json)
|
| 7 |
+
case_glob: /mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/ws/arrange_topple_dominoes__3_*
|
| 8 |
+
|
| 9 |
+
raf:
|
| 10 |
+
root: /tmp/raf_official
|
| 11 |
+
genesis_world: /tmp/raf_official/third_party/genesis-world # 官方 FPS 采样器所在
|
| 12 |
+
|
| 13 |
+
psivg:
|
| 14 |
+
root: /mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/PSIVG/PSIVG
|
| 15 |
+
|
| 16 |
+
runtime:
|
| 17 |
+
out_root: /mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs
|
pipeline_rigid/01_ovow_mesh_6dof/build_scene.py
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
"""01_ovow_mesh_6dof/build_scene.py — 读取 OVOW 产物,产出统一 scene.json。
|
| 3 |
+
|
| 4 |
+
原代码出处(只读,不改):
|
| 5 |
+
OVOW run-dir/
|
| 6 |
+
objects/<name>/mid_files/scaled_mesh.obj ← 真实尺度 mesh(OVOW step 产物)
|
| 7 |
+
objects/<name>/pose_result/poses.json ← c_T_o 逐帧 6-DoF 位姿
|
| 8 |
+
results/result.npz ← extrinsics(w2c) / intrinsics
|
| 9 |
+
世界位姿按 OVOW 工具 physics_project_z_deform_seq.py 的口径:
|
| 10 |
+
w_T_o = inv(extrinsics[t]) @ c_T_o
|
| 11 |
+
(extrinsics[0] = I,故世界系 = 第 0 帧相机系)
|
| 12 |
+
|
| 13 |
+
本文件只做读取 / 坐标换算 / 地面拟合,不产生任何物理量。
|
| 14 |
+
"""
|
| 15 |
+
from __future__ import annotations
|
| 16 |
+
|
| 17 |
+
import argparse
|
| 18 |
+
import os
|
| 19 |
+
import sys
|
| 20 |
+
from pathlib import Path
|
| 21 |
+
|
| 22 |
+
import numpy as np
|
| 23 |
+
|
| 24 |
+
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
| 25 |
+
import chain_common as cc
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
# 材质语义(喂给 PSIVG map_physical_params 的 LVLM 风格描述)
|
| 29 |
+
SEMANTIC = {
|
| 30 |
+
"domino": {
|
| 31 |
+
"material_class": "wood",
|
| 32 |
+
"solidity": "solid",
|
| 33 |
+
"hardness_level": "hard",
|
| 34 |
+
"bounce_category": "low_bounce",
|
| 35 |
+
"friction_tendency": "grippy",
|
| 36 |
+
"surface_roughness_level": 3,
|
| 37 |
+
"size_thickness_hint": "thin_and_small",
|
| 38 |
+
},
|
| 39 |
+
"table": {
|
| 40 |
+
"material_class": "wood",
|
| 41 |
+
"solidity": "solid",
|
| 42 |
+
"hardness_level": "hard",
|
| 43 |
+
"bounce_category": "low_bounce",
|
| 44 |
+
"friction_tendency": "medium",
|
| 45 |
+
"surface_roughness_level": 3,
|
| 46 |
+
"size_thickness_hint": "thick_and_large",
|
| 47 |
+
},
|
| 48 |
+
"hand": {
|
| 49 |
+
"material_class": "soft_plastic_or_rubber",
|
| 50 |
+
"solidity": "solid",
|
| 51 |
+
"hardness_level": "soft",
|
| 52 |
+
"bounce_category": "low_bounce",
|
| 53 |
+
"friction_tendency": "grippy",
|
| 54 |
+
"surface_roughness_level": 4,
|
| 55 |
+
"size_thickness_hint": "thick_and_small",
|
| 56 |
+
},
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
def load_poses(path: Path) -> dict[int, np.ndarray]:
|
| 61 |
+
raw = cc.load_json(path)
|
| 62 |
+
out = {}
|
| 63 |
+
for k, v in raw.items():
|
| 64 |
+
try:
|
| 65 |
+
out[int(k)] = np.asarray(v, dtype=np.float64)
|
| 66 |
+
except (TypeError, ValueError):
|
| 67 |
+
continue
|
| 68 |
+
return out
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
def pick_mesh(obj_dir: Path) -> Path | None:
|
| 72 |
+
for rel in ("mid_files/scaled_mesh.obj", "model/model.obj"):
|
| 73 |
+
p = obj_dir / rel
|
| 74 |
+
if p.exists():
|
| 75 |
+
return p
|
| 76 |
+
return None
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
def main() -> None:
|
| 80 |
+
ap = argparse.ArgumentParser()
|
| 81 |
+
ap.add_argument("--paths", required=True)
|
| 82 |
+
ap.add_argument("--out", required=True, help="输出目录(scene.json 落在这里)")
|
| 83 |
+
args = ap.parse_args()
|
| 84 |
+
|
| 85 |
+
out_dir = Path(args.out)
|
| 86 |
+
out_dir.mkdir(parents=True, exist_ok=True)
|
| 87 |
+
|
| 88 |
+
cfg = cc.load_paths(args.paths)
|
| 89 |
+
case_dir = cc.resolve_case_dir(cfg["ovow"]["case_glob"])
|
| 90 |
+
run_dir = cc.resolve_run_dir(case_dir)
|
| 91 |
+
cc.log("01", f"case={case_dir.name} run={run_dir.name}")
|
| 92 |
+
|
| 93 |
+
data = np.load(run_dir / "results" / "result.npz")
|
| 94 |
+
extrinsics = np.asarray(data["extrinsics"], dtype=np.float64) # w2c
|
| 95 |
+
intrinsics = np.asarray(data["intrinsics"], dtype=np.float64)
|
| 96 |
+
n_frames = extrinsics.shape[0]
|
| 97 |
+
|
| 98 |
+
meta_path = case_dir / "metadata" / f"{run_dir.name}_labels.json"
|
| 99 |
+
meta = cc.load_json(meta_path) if meta_path.exists() else {}
|
| 100 |
+
fps = float(meta.get("fps", 30.0))
|
| 101 |
+
n_video_frames = int(meta.get("num_frames", n_frames))
|
| 102 |
+
# poses.json 34 帧 / 视频 102 帧 → 采样步长 3
|
| 103 |
+
stride = max(1, int(round(n_video_frames / n_frames)))
|
| 104 |
+
|
| 105 |
+
import trimesh
|
| 106 |
+
|
| 107 |
+
objects = []
|
| 108 |
+
obj_root = run_dir / "objects"
|
| 109 |
+
for obj_dir in sorted(p for p in obj_root.iterdir() if p.is_dir()):
|
| 110 |
+
name = obj_dir.name
|
| 111 |
+
if not name.startswith(("domino", "table", "hand")):
|
| 112 |
+
continue
|
| 113 |
+
mesh_path = pick_mesh(obj_dir)
|
| 114 |
+
pose_path = obj_dir / "pose_result" / "poses.json"
|
| 115 |
+
if mesh_path is None or not pose_path.exists():
|
| 116 |
+
cc.log("01", f"skip {name}(缺 mesh 或 poses)")
|
| 117 |
+
continue
|
| 118 |
+
mesh = trimesh.load(mesh_path, force="mesh", process=False)
|
| 119 |
+
poses = load_poses(pose_path)
|
| 120 |
+
frames = sorted(poses)
|
| 121 |
+
world = np.stack([np.linalg.inv(extrinsics[t]) @ poses[t]
|
| 122 |
+
for t in frames]) # [F,4,4]
|
| 123 |
+
kind = "domino" if name.startswith("domino") else \
|
| 124 |
+
("table" if name.startswith("table") else "hand")
|
| 125 |
+
objects.append({
|
| 126 |
+
"name": name,
|
| 127 |
+
"kind": kind,
|
| 128 |
+
"mesh": str(mesh_path),
|
| 129 |
+
"extents": np.asarray(mesh.extents, dtype=np.float64),
|
| 130 |
+
"volume": float(abs(mesh.volume)) if mesh.is_volume else None,
|
| 131 |
+
"frames": frames,
|
| 132 |
+
"world_poses": world,
|
| 133 |
+
"semantic": SEMANTIC[kind],
|
| 134 |
+
})
|
| 135 |
+
cc.log("01", f"objects={len(objects)} "
|
| 136 |
+
f"(domino={sum(o['kind']=='domino' for o in objects)})")
|
| 137 |
+
|
| 138 |
+
# ---- 地面:桌面 mesh 的最薄轴即法向(43cm 平板比 17 块小骨牌的底片可靠)----
|
| 139 |
+
table = next((o for o in objects if o["kind"] == "table"), None)
|
| 140 |
+
if table is not None:
|
| 141 |
+
w_T_t = table["world_poses"][0]
|
| 142 |
+
thin = int(np.argmin(table["extents"]))
|
| 143 |
+
up = w_T_t[:3, :3] @ np.eye(3)[thin]
|
| 144 |
+
up /= np.linalg.norm(up)
|
| 145 |
+
c_tab = w_T_t[:3, 3]
|
| 146 |
+
if float(up @ (-c_tab)) < 0: # 让 up 指向相机一侧(相机在桌面上方)
|
| 147 |
+
up = -up
|
| 148 |
+
ground_c = c_tab + up * float(table["extents"][thin]) / 2.0
|
| 149 |
+
ground_n = up
|
| 150 |
+
else:
|
| 151 |
+
bottoms = []
|
| 152 |
+
for o in objects:
|
| 153 |
+
if o["kind"] != "domino":
|
| 154 |
+
continue
|
| 155 |
+
w_T_o = o["world_poses"][0]
|
| 156 |
+
m = trimesh.load(o["mesh"], force="mesh", process=False)
|
| 157 |
+
vw = np.asarray(m.vertices, dtype=np.float64) @ w_T_o[:3, :3].T + w_T_o[:3, 3]
|
| 158 |
+
h = (vw - vw.mean(axis=0)) @ np.array([0.0, -1.0, 0.0])
|
| 159 |
+
thr = h.min() + 0.06 * (h.max() - h.min())
|
| 160 |
+
bottoms.append(vw[h <= thr])
|
| 161 |
+
if bottoms:
|
| 162 |
+
ground_c, ground_n = cc.fit_plane(np.vstack(bottoms))
|
| 163 |
+
if float(ground_n @ (-np.asarray(objects[0]["world_poses"][0])[:3, 3])) < 0:
|
| 164 |
+
ground_n = -ground_n
|
| 165 |
+
up = ground_n
|
| 166 |
+
else:
|
| 167 |
+
ground_c, ground_n = np.array([0.0, 0.0, 0.0]), np.array([0.0, -1.0, 0.0])
|
| 168 |
+
up = ground_n
|
| 169 |
+
|
| 170 |
+
gravity = -9.81 * up
|
| 171 |
+
dt_sample = stride / fps
|
| 172 |
+
|
| 173 |
+
# ---- 初速度:由 OVOW 观测位姿 0→1 差分(线性 + 角速度) ----
|
| 174 |
+
for o in objects:
|
| 175 |
+
w0, w1 = o["world_poses"][0], o["world_poses"][1]
|
| 176 |
+
o["v0"] = (w1[:3, 3] - w0[:3, 3]) / dt_sample
|
| 177 |
+
o["omega0"] = cc.log_map_so3(w0[:3, :3].T @ w1[:3, :3]) / dt_sample
|
| 178 |
+
|
| 179 |
+
scene = {
|
| 180 |
+
"stage": "01_ovow_mesh_6dof",
|
| 181 |
+
"source": {
|
| 182 |
+
"case_dir": str(case_dir),
|
| 183 |
+
"run_dir": str(run_dir),
|
| 184 |
+
"video": str(case_dir.parent.parent / "videos_in" / f"{run_dir.name}.mp4"),
|
| 185 |
+
"fps": fps,
|
| 186 |
+
"pose_stride": stride,
|
| 187 |
+
"n_pose_frames": int(n_frames),
|
| 188 |
+
"n_video_frames": int(meta.get("num_frames", n_frames * stride)),
|
| 189 |
+
},
|
| 190 |
+
"camera": {
|
| 191 |
+
# PSIVG project() 需要 camera-to-world,这里存 w2c,用时取逆
|
| 192 |
+
"extrinsics_w2c": extrinsics,
|
| 193 |
+
"intrinsics": intrinsics,
|
| 194 |
+
},
|
| 195 |
+
"ground": {
|
| 196 |
+
"point": ground_c,
|
| 197 |
+
"normal": ground_n,
|
| 198 |
+
"gravity": gravity,
|
| 199 |
+
},
|
| 200 |
+
"objects": objects,
|
| 201 |
+
"provenance": {
|
| 202 |
+
"mesh_6dof": "OVOW engine/batch_scene_pipeline.py 产物(scaled_mesh.obj + poses.json)",
|
| 203 |
+
"world_pose": "OVOW engine/tools/physics_project_z_deform_seq.py: w_T_o = inv(E[t]) @ c_T_o",
|
| 204 |
+
"ground_fit": "pipeline 编排层:取 table mesh 最薄轴为法向、顶面为平面点(表 43cm 平板比小骨牌底片更可靠)",
|
| 205 |
+
},
|
| 206 |
+
}
|
| 207 |
+
cc.dump_json(out_dir / "scene.json", scene)
|
| 208 |
+
cc.log("01", f"ground point={np.round(ground_c,4)} up={np.round(up,4)} "
|
| 209 |
+
f"gravity={np.round(gravity,3)}")
|
| 210 |
+
cc.log("01", f"→ {out_dir/'scene.json'}")
|
| 211 |
+
|
| 212 |
+
|
| 213 |
+
if __name__ == "__main__":
|
| 214 |
+
main()
|
pipeline_rigid/02_raf_particles/particleize.py
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
"""02_raf_particles/particleize.py — RAF 粒子化(直接调官方实现)。
|
| 3 |
+
|
| 4 |
+
原代码出处(不改一行):
|
| 5 |
+
/tmp/raf_official/third_party/genesis-world/genesis/utils/point_cloud.py
|
| 6 |
+
sample_mesh_point_cloud(verts, faces, n_points, ...) → 面积加权采样 + FPS
|
| 7 |
+
这正是 RAF 把 mesh 资产翻译成统一粒子集时用的官方采样器。
|
| 8 |
+
|
| 9 |
+
输出:particles/<name>.npz(局部坐标 [N,3])+ particles/index.json
|
| 10 |
+
"""
|
| 11 |
+
from __future__ import annotations
|
| 12 |
+
|
| 13 |
+
import argparse
|
| 14 |
+
import sys
|
| 15 |
+
from pathlib import Path
|
| 16 |
+
|
| 17 |
+
import numpy as np
|
| 18 |
+
|
| 19 |
+
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
| 20 |
+
import chain_common as cc
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def main() -> None:
|
| 24 |
+
ap = argparse.ArgumentParser()
|
| 25 |
+
ap.add_argument("--paths", required=True)
|
| 26 |
+
ap.add_argument("--scene", required=True)
|
| 27 |
+
ap.add_argument("--out", required=True)
|
| 28 |
+
ap.add_argument("--n-points", type=int, default=400, help="每个刚体的表面粒子数")
|
| 29 |
+
args = ap.parse_args()
|
| 30 |
+
|
| 31 |
+
cfg = cc.load_paths(args.paths)
|
| 32 |
+
genesis_world = cfg["raf"]["genesis_world"]
|
| 33 |
+
sys.path.insert(0, genesis_world)
|
| 34 |
+
import genesis as gs
|
| 35 |
+
# 官方采样器用到 gs.np_float,该常量在 gs.init() 里才设置
|
| 36 |
+
gs.init(backend=gs.cpu, logging_level="warning")
|
| 37 |
+
from genesis.utils.point_cloud import sample_mesh_point_cloud
|
| 38 |
+
|
| 39 |
+
import trimesh
|
| 40 |
+
|
| 41 |
+
scene = cc.load_json(args.scene)
|
| 42 |
+
out = Path(args.out) / "particles"
|
| 43 |
+
out.mkdir(parents=True, exist_ok=True)
|
| 44 |
+
|
| 45 |
+
index = {}
|
| 46 |
+
for obj in scene["objects"]:
|
| 47 |
+
mesh = trimesh.load(obj["mesh"], force="mesh", process=False)
|
| 48 |
+
verts = np.asarray(mesh.vertices, dtype=np.float64)
|
| 49 |
+
faces = np.asarray(mesh.faces, dtype=np.int64)
|
| 50 |
+
pts = sample_mesh_point_cloud(
|
| 51 |
+
verts, faces, int(args.n_points),
|
| 52 |
+
n_candidates=max(256, int(args.n_points) * 4), seed=0,
|
| 53 |
+
)
|
| 54 |
+
pts = np.asarray(pts, dtype=np.float64)
|
| 55 |
+
np.savez_compressed(out / f"{obj['name']}.npz", points=pts)
|
| 56 |
+
index[obj["name"]] = {
|
| 57 |
+
"n": int(pts.shape[0]),
|
| 58 |
+
"file": str(out / f"{obj['name']}.npz"),
|
| 59 |
+
"source_mesh": obj["mesh"],
|
| 60 |
+
}
|
| 61 |
+
cc.log("02", f"{obj['name']}: {pts.shape[0]} particles")
|
| 62 |
+
|
| 63 |
+
cc.dump_json(Path(args.out) / "particles" / "index.json", {
|
| 64 |
+
"stage": "02_raf_particles",
|
| 65 |
+
"sampler": "genesis.utils.point_cloud.sample_mesh_point_cloud (RAF 官方)",
|
| 66 |
+
"n_points_per_object": int(args.n_points),
|
| 67 |
+
"objects": index,
|
| 68 |
+
})
|
| 69 |
+
cc.log("02", f"→ {out}/index.json")
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
if __name__ == "__main__":
|
| 73 |
+
main()
|
pipeline_rigid/03_vipe_flow/run_vipe.py
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
"""03_vipe_flow/run_vipe.py — 光流阶段(ViPE,PSIVG 原代码)。
|
| 3 |
+
|
| 4 |
+
ViPE = NVIDIA Video Pose Engine(PSIVG README 明确其建于 ViPE 之上)。
|
| 5 |
+
原代码入口:
|
| 6 |
+
psivg/perception/vipe/run.py (SLAM + 深度 + 相机,config 驱动)
|
| 7 |
+
psivg/perception/vipe/velocity_field.py
|
| 8 |
+
psivg/perception/vipe/configs/
|
| 9 |
+
|
| 10 |
+
本轮 rigid 交付的目标是"能看的骨牌仿真视频 + 每步原代码出处",
|
| 11 |
+
光流不是渲染必需项,故默认跳过(写入显式状态,不用自写光流顶替)。
|
| 12 |
+
需要时加 --enable 直接调官方入口。
|
| 13 |
+
"""
|
| 14 |
+
from __future__ import annotations
|
| 15 |
+
|
| 16 |
+
import argparse
|
| 17 |
+
import subprocess
|
| 18 |
+
import sys
|
| 19 |
+
from pathlib import Path
|
| 20 |
+
|
| 21 |
+
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
| 22 |
+
import chain_common as cc
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
def main() -> None:
|
| 26 |
+
ap = argparse.ArgumentParser()
|
| 27 |
+
ap.add_argument("--paths", required=True)
|
| 28 |
+
ap.add_argument("--scene", required=True)
|
| 29 |
+
ap.add_argument("--out", required=True)
|
| 30 |
+
ap.add_argument("--enable", action="store_true", help="真正运行官方 ViPE 入口")
|
| 31 |
+
args = ap.parse_args()
|
| 32 |
+
|
| 33 |
+
cfg = cc.load_paths(args.paths)
|
| 34 |
+
root = Path(cfg["psivg"]["root"])
|
| 35 |
+
entry = root / "psivg/perception/vipe/run.py"
|
| 36 |
+
scene = cc.load_json(args.scene)
|
| 37 |
+
out = Path(args.out)
|
| 38 |
+
out.mkdir(parents=True, exist_ok=True)
|
| 39 |
+
|
| 40 |
+
payload = {
|
| 41 |
+
"stage": "03_vipe_flow",
|
| 42 |
+
"entry": str(entry),
|
| 43 |
+
"video": scene["source"]["video"],
|
| 44 |
+
"status": "skipped",
|
| 45 |
+
"reason": "rigid 渲染不依赖光流;未用自写光流顶替,保持口径干净",
|
| 46 |
+
}
|
| 47 |
+
if args.enable:
|
| 48 |
+
if not entry.exists():
|
| 49 |
+
raise FileNotFoundError(entry)
|
| 50 |
+
cmd = [sys.executable, str(entry)]
|
| 51 |
+
cc.log("03", "运行官方 ViPE: " + " ".join(cmd))
|
| 52 |
+
proc = subprocess.run(cmd, cwd=str(root))
|
| 53 |
+
payload["status"] = "ok" if proc.returncode == 0 else "failed"
|
| 54 |
+
payload["returncode"] = proc.returncode
|
| 55 |
+
cc.dump_json(out / "flow_status.json", payload)
|
| 56 |
+
cc.log("03", f"status={payload['status']} → {out/'flow_status.json'}")
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
if __name__ == "__main__":
|
| 60 |
+
main()
|
pipeline_rigid/04_psivg_sim/run_rigid_sim.py
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
"""04_psivg_sim/run_rigid_sim.py — 刚体多体仿真(Genesis 官方 rigid solver)。
|
| 3 |
+
|
| 4 |
+
为什么不是 PSIVG 的 run_mpm_simulation:
|
| 5 |
+
PSIVG 的 MPM 场景入口 load_scene_data() 只支持 "1 个 primary + 1 个 secondary"
|
| 6 |
+
的旋转冲击场景(依赖 OUT_ViPE_Export 的 video_info/frames_info),无法表达
|
| 7 |
+
17 块骨牌的链式接触。而 RAF 论文的刚体求解器就是 Genesis(官方仓库
|
| 8 |
+
third_party/genesis-world),骨牌是纯刚体,用 Genesis Rigid 才是论文原代码口径。
|
| 9 |
+
布料/流体阶段仍走 PSIVG MPM/SPH。
|
| 10 |
+
|
| 11 |
+
原代码出处(不改):
|
| 12 |
+
genesis-world: gs.Scene / gs.morphs.Mesh / gs.materials.Rigid
|
| 13 |
+
PSIVG psivg/simulation/physics_mapping.py::map_physical_params
|
| 14 |
+
→ density / mu_dynamic / coeff_restitution(材质语义映射)
|
| 15 |
+
|
| 16 |
+
输入:scene.json(世界系 = 第 0 帧相机系)、particles/index.json
|
| 17 |
+
输出:sim.npz(逐帧刚体位姿 + 速度 + 粒子世界坐标 + 质量)
|
| 18 |
+
"""
|
| 19 |
+
from __future__ import annotations
|
| 20 |
+
|
| 21 |
+
import argparse
|
| 22 |
+
import sys
|
| 23 |
+
from pathlib import Path
|
| 24 |
+
|
| 25 |
+
import numpy as np
|
| 26 |
+
|
| 27 |
+
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
| 28 |
+
import chain_common as cc
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
def filter_kwargs(cls, kwargs: dict) -> dict:
|
| 32 |
+
fields = getattr(cls, "model_fields", None)
|
| 33 |
+
if not fields:
|
| 34 |
+
return kwargs
|
| 35 |
+
return {k: v for k, v in kwargs.items() if k in fields}
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
def np_of(x) -> np.ndarray:
|
| 39 |
+
"""torch tensor(可能在 cuda)→ numpy。"""
|
| 40 |
+
if hasattr(x, "detach"):
|
| 41 |
+
x = x.detach().cpu().numpy()
|
| 42 |
+
return np.asarray(x, dtype=np.float64)
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def main() -> None:
|
| 46 |
+
ap = argparse.ArgumentParser()
|
| 47 |
+
ap.add_argument("--paths", required=True)
|
| 48 |
+
ap.add_argument("--scene", required=True)
|
| 49 |
+
ap.add_argument("--particles", required=True)
|
| 50 |
+
ap.add_argument("--out", required=True)
|
| 51 |
+
ap.add_argument("--steps", type=int, default=0, help="0=按视频帧数")
|
| 52 |
+
ap.add_argument("--substeps", type=int, default=4)
|
| 53 |
+
args = ap.parse_args()
|
| 54 |
+
|
| 55 |
+
cfg = cc.load_paths(args.paths)
|
| 56 |
+
sys.path.insert(0, cfg["raf"]["genesis_world"])
|
| 57 |
+
import genesis as gs
|
| 58 |
+
|
| 59 |
+
scene_json = cc.load_json(args.scene)
|
| 60 |
+
part_index = cc.load_json(Path(args.particles) / "particles" / "index.json")
|
| 61 |
+
|
| 62 |
+
# PSIVG 材质映射(原代码,不改)
|
| 63 |
+
phys_map = cc.import_file(
|
| 64 |
+
"psivg_physics_mapping",
|
| 65 |
+
Path(cfg["psivg"]["root"]) / "psivg/simulation/physics_mapping.py")
|
| 66 |
+
|
| 67 |
+
gs.init(backend=gs.gpu, precision="32", logging_level="warning")
|
| 68 |
+
|
| 69 |
+
fps = float(scene_json["source"]["fps"])
|
| 70 |
+
dt = 1.0 / fps
|
| 71 |
+
n_steps = int(args.steps) or int(scene_json["source"]["n_video_frames"])
|
| 72 |
+
ground = scene_json["ground"]
|
| 73 |
+
up = np.asarray(ground["normal"], dtype=np.float64)
|
| 74 |
+
gp = np.asarray(ground["point"], dtype=np.float64)
|
| 75 |
+
gravity = np.asarray(ground["gravity"], dtype=np.float64)
|
| 76 |
+
|
| 77 |
+
sim_opts = filter_kwargs(gs.options.SimOptions, dict(
|
| 78 |
+
dt=dt, substeps=int(args.substeps), gravity=tuple(gravity)))
|
| 79 |
+
scene = gs.Scene(sim_options=gs.options.SimOptions(**sim_opts),
|
| 80 |
+
show_viewer=False, show_FPS=False)
|
| 81 |
+
|
| 82 |
+
# ---- 地面(骨牌桌面):用拟合平面的法向放置 Plane ----
|
| 83 |
+
plane_morph = gs.morphs.Plane(pos=tuple(gp), normal=tuple(up), plane_size=(3.0, 3.0))
|
| 84 |
+
plane_mat = gs.materials.Rigid(friction=0.6)
|
| 85 |
+
scene.add_entity(plane_morph, material=plane_mat)
|
| 86 |
+
|
| 87 |
+
entities = []
|
| 88 |
+
meta = []
|
| 89 |
+
for obj in scene_json["objects"]:
|
| 90 |
+
if obj["kind"] not in ("domino", "table"):
|
| 91 |
+
continue
|
| 92 |
+
w_T = np.asarray(obj["world_poses"][0], dtype=np.float64)
|
| 93 |
+
quat = cc.rotmat_to_quat_wxyz(w_T[:3, :3])
|
| 94 |
+
fixed = obj["kind"] == "table"
|
| 95 |
+
params = phys_map.map_physical_params(obj["semantic"])
|
| 96 |
+
morph = gs.morphs.Mesh(
|
| 97 |
+
file=obj["mesh"], pos=tuple(w_T[:3, 3]), quat=tuple(quat),
|
| 98 |
+
fixed=fixed, convexify=not fixed, decimate=not fixed,
|
| 99 |
+
)
|
| 100 |
+
mat_kwargs = filter_kwargs(gs.materials.Rigid, dict(
|
| 101 |
+
rho=float(params.density), friction=float(params.mu_dynamic)))
|
| 102 |
+
ent = scene.add_entity(morph, material=gs.materials.Rigid(**mat_kwargs))
|
| 103 |
+
entities.append(ent)
|
| 104 |
+
pts = np.load(part_index["objects"][obj["name"]]["file"])["points"]
|
| 105 |
+
meta.append({
|
| 106 |
+
"name": obj["name"], "kind": obj["kind"],
|
| 107 |
+
"density": float(params.density),
|
| 108 |
+
"friction": float(params.mu_dynamic),
|
| 109 |
+
"restitution": float(params.coeff_restitution),
|
| 110 |
+
"points": np.asarray(pts, dtype=np.float64),
|
| 111 |
+
"v0": np.asarray(obj["v0"], dtype=np.float64) if not fixed else np.zeros(3),
|
| 112 |
+
"omega0": np.asarray(obj["omega0"], dtype=np.float64) if not fixed else np.zeros(3),
|
| 113 |
+
})
|
| 114 |
+
cc.log("04", f"entities={len(entities)} "
|
| 115 |
+
f"(dynamic={sum(m['kind']=='domino' for m in meta)})")
|
| 116 |
+
|
| 117 |
+
scene.build()
|
| 118 |
+
|
| 119 |
+
# ---- 初速度:OVOW 观测位姿 0→1 差分(线性 + 角速度) ----
|
| 120 |
+
for ent, m in zip(entities, meta):
|
| 121 |
+
if m["kind"] == "table":
|
| 122 |
+
continue
|
| 123 |
+
try:
|
| 124 |
+
ent.set_dofs_velocity(np.concatenate([m["v0"], m["omega0"]]))
|
| 125 |
+
except Exception as exc: # 记录而不静默
|
| 126 |
+
cc.log("04", f"WARN set_dofs_velocity({m['name']}) 失败: {exc}")
|
| 127 |
+
|
| 128 |
+
masses = []
|
| 129 |
+
for ent in entities:
|
| 130 |
+
try:
|
| 131 |
+
masses.append(float(np_of(ent.get_mass()).reshape(-1)[0]))
|
| 132 |
+
except Exception:
|
| 133 |
+
masses.append(float("nan"))
|
| 134 |
+
|
| 135 |
+
n_obj = len(entities)
|
| 136 |
+
poses = np.zeros((n_steps + 1, n_obj, 4, 4))
|
| 137 |
+
lin = np.zeros((n_steps + 1, n_obj, 3))
|
| 138 |
+
ang = np.zeros((n_steps + 1, n_obj, 3))
|
| 139 |
+
parts = np.zeros((n_steps + 1, sum(m["points"].shape[0] for m in meta), 3))
|
| 140 |
+
|
| 141 |
+
def record(t: int) -> None:
|
| 142 |
+
off = 0
|
| 143 |
+
for j, (ent, m) in enumerate(zip(entities, meta)):
|
| 144 |
+
pos = np_of(ent.get_pos()).reshape(3)
|
| 145 |
+
q = np_of(ent.get_quat()).reshape(4) # wxyz
|
| 146 |
+
w, x, y, z = q
|
| 147 |
+
R = np.array([
|
| 148 |
+
[1 - 2 * (y * y + z * z), 2 * (x * y - w * z), 2 * (x * z + w * y)],
|
| 149 |
+
[2 * (x * y + w * z), 1 - 2 * (x * x + z * z), 2 * (y * z - w * x)],
|
| 150 |
+
[2 * (x * z - w * y), 2 * (y * z + w * x), 1 - 2 * (x * x + y * y)],
|
| 151 |
+
])
|
| 152 |
+
poses[t, j] = np.block([[R, pos[:, None]], [np.zeros(3), 1.0]])
|
| 153 |
+
try:
|
| 154 |
+
vel = np_of(ent.get_vel()).reshape(-1)
|
| 155 |
+
if vel.size >= 6:
|
| 156 |
+
lin[t, j], ang[t, j] = vel[:3], vel[3:6]
|
| 157 |
+
elif vel.size >= 3:
|
| 158 |
+
lin[t, j] = vel[:3]
|
| 159 |
+
except Exception:
|
| 160 |
+
pass
|
| 161 |
+
n = m["points"].shape[0]
|
| 162 |
+
parts[t, off:off + n] = m["points"] @ R.T + pos
|
| 163 |
+
off += n
|
| 164 |
+
|
| 165 |
+
record(0)
|
| 166 |
+
for t in range(1, n_steps + 1):
|
| 167 |
+
scene.step()
|
| 168 |
+
record(t)
|
| 169 |
+
if t % 20 == 0 or t == n_steps:
|
| 170 |
+
cc.log("04", f"step {t}/{n_steps}")
|
| 171 |
+
|
| 172 |
+
out = Path(args.out)
|
| 173 |
+
out.mkdir(parents=True, exist_ok=True)
|
| 174 |
+
np.savez_compressed(
|
| 175 |
+
out / "sim.npz",
|
| 176 |
+
poses=poses, lin_vel=lin, ang_vel=ang, particles=parts,
|
| 177 |
+
masses=np.asarray(masses), fps=np.asarray(fps),
|
| 178 |
+
names=np.asarray([m["name"] for m in meta]),
|
| 179 |
+
point_counts=np.asarray([m["points"].shape[0] for m in meta]),
|
| 180 |
+
)
|
| 181 |
+
cc.dump_json(out / "sim_meta.json", {
|
| 182 |
+
"stage": "04_psivg_sim",
|
| 183 |
+
"solver": "genesis-world rigid solver(RAF 官方刚体求解器)",
|
| 184 |
+
"why_not_psivg_mpm": "PSIVG MPM 入口仅支持 primary+secondary 两体旋转冲击场景,"
|
| 185 |
+
"无法表达 17 块骨牌链式接触",
|
| 186 |
+
"dt": dt, "substeps": int(args.substeps), "n_steps": n_steps,
|
| 187 |
+
"gravity": gravity, "ground_point": gp, "ground_normal": up,
|
| 188 |
+
"objects": [{k: v for k, v in m.items() if k not in ("points",)}
|
| 189 |
+
for m in meta],
|
| 190 |
+
"mass": masses,
|
| 191 |
+
"physics_mapping": "PSIVG psivg/simulation/physics_mapping.py::map_physical_params",
|
| 192 |
+
})
|
| 193 |
+
cc.log("04", f"→ {out/'sim.npz'}")
|
| 194 |
+
|
| 195 |
+
|
| 196 |
+
if __name__ == "__main__":
|
| 197 |
+
main()
|
pipeline_rigid/05_projection_flow/project_particles.py
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
"""05_projection_flow/project_particles.py — 世界粒子 → 像素(PSIVG 原代码)。
|
| 3 |
+
|
| 4 |
+
原代码出处(不改):
|
| 5 |
+
psivg/rendering/projection.py::project(points, extrinsics, intrinsics)
|
| 6 |
+
注意该函数要求 extrinsics 是 camera-to-world,而 OVOW 存的是 w2c,
|
| 7 |
+
故这里传入 inv(extrinsics_w2c)。
|
| 8 |
+
|
| 9 |
+
输入:scene.json(相机)、sim.npz(逐帧粒子世界坐标)
|
| 10 |
+
输出:projected.npz(pix [F,N,2] / depth [F,N] / frame_index)
|
| 11 |
+
"""
|
| 12 |
+
from __future__ import annotations
|
| 13 |
+
|
| 14 |
+
import argparse
|
| 15 |
+
import sys
|
| 16 |
+
from pathlib import Path
|
| 17 |
+
|
| 18 |
+
import numpy as np
|
| 19 |
+
|
| 20 |
+
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
| 21 |
+
import chain_common as cc
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def main() -> None:
|
| 25 |
+
ap = argparse.ArgumentParser()
|
| 26 |
+
ap.add_argument("--paths", required=True)
|
| 27 |
+
ap.add_argument("--scene", required=True)
|
| 28 |
+
ap.add_argument("--sim", required=True)
|
| 29 |
+
ap.add_argument("--out", required=True)
|
| 30 |
+
args = ap.parse_args()
|
| 31 |
+
|
| 32 |
+
cfg = cc.load_paths(args.paths)
|
| 33 |
+
proj = cc.import_file(
|
| 34 |
+
"psivg_projection",
|
| 35 |
+
Path(cfg["psivg"]["root"]) / "psivg/rendering/projection.py")
|
| 36 |
+
|
| 37 |
+
scene = cc.load_json(args.scene)
|
| 38 |
+
sim = np.load(Path(args.sim) / "sim.npz")
|
| 39 |
+
parts = np.asarray(sim["particles"], dtype=np.float64) # [F,N,3]
|
| 40 |
+
n_sim_frames = parts.shape[0]
|
| 41 |
+
|
| 42 |
+
E_w2c = np.asarray(scene["camera"]["extrinsics_w2c"], dtype=np.float64)
|
| 43 |
+
K_all = np.asarray(scene["camera"]["intrinsics"], dtype=np.float64)
|
| 44 |
+
stride = int(scene["source"]["pose_stride"])
|
| 45 |
+
n_pose = E_w2c.shape[0]
|
| 46 |
+
|
| 47 |
+
pix = np.zeros((n_sim_frames, parts.shape[1], 2), dtype=np.float32)
|
| 48 |
+
depth = np.zeros((n_sim_frames, parts.shape[1]), dtype=np.float32)
|
| 49 |
+
frame_idx = np.zeros(n_sim_frames, dtype=np.int64)
|
| 50 |
+
|
| 51 |
+
for t in range(n_sim_frames):
|
| 52 |
+
# sim 帧 t 对应视频帧 t,对应位姿帧 t//stride
|
| 53 |
+
pf = min(t // stride, n_pose - 1)
|
| 54 |
+
frame_idx[t] = pf
|
| 55 |
+
c2w = np.linalg.inv(E_w2c[pf])
|
| 56 |
+
xy, z = proj.project(parts[t], c2w, K_all[pf])
|
| 57 |
+
pix[t] = np.asarray(xy, dtype=np.float32)
|
| 58 |
+
depth[t] = np.asarray(z, dtype=np.float32)
|
| 59 |
+
|
| 60 |
+
out = Path(args.out)
|
| 61 |
+
out.mkdir(parents=True, exist_ok=True)
|
| 62 |
+
np.savez_compressed(out / "projected.npz",
|
| 63 |
+
pix=pix, depth=depth, frame_index=frame_idx)
|
| 64 |
+
cc.dump_json(out / "projection_meta.json", {
|
| 65 |
+
"stage": "05_projection_flow",
|
| 66 |
+
"projection": "PSIVG psivg/rendering/projection.py::project(extrinsics=camera-to-world)",
|
| 67 |
+
"n_sim_frames": int(n_sim_frames),
|
| 68 |
+
"pose_stride": stride,
|
| 69 |
+
"image_size": [int(K_all[0][1, 2] * 2), int(K_all[0][0, 2] * 2)],
|
| 70 |
+
})
|
| 71 |
+
cc.log("05", f"→ {out/'projected.npz'} pix range "
|
| 72 |
+
f"[{np.nanmin(pix):.1f},{np.nanmax(pix):.1f}]")
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
if __name__ == "__main__":
|
| 76 |
+
main()
|
pipeline_rigid/06_conservation/conservation.py
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
"""06_conservation/conservation.py — 能量/动量台账(IMPACT 公式)。
|
| 3 |
+
|
| 4 |
+
IMPACT 没有公开代码(H100 全盘检索 *impact* 为 0),故本步是全链唯一
|
| 5 |
+
按论文公式自实现的部分,逐项标注公式:
|
| 6 |
+
|
| 7 |
+
(1) 动能 E_k(t) = Σ_i ½ m_i ||v_i||²
|
| 8 |
+
(2) 势能 E_p(t) = Σ_i m_i g h_i , h_i = (x_i - p_plane)·n_up
|
| 9 |
+
(3) 总能量 E(t) = E_k + E_p
|
| 10 |
+
(4) 能量预算 E(t+1) ≤ E(t) + W_ext (W_ext 为外力做功,本场景无外力)
|
| 11 |
+
(5) 线动量 P(t) = Σ_i m_i v_i ;无外力时 ||P(t) - P(0)|| 应≈0
|
| 12 |
+
(6) 反弹越界检测:E_p(t) > E_p(0) + tol 即"弹回到释放高度以上"(IMPACT 动机)
|
| 13 |
+
|
| 14 |
+
粒子速度按刚体运动学 v_i = v_body + ω × r_i 由 sim.npz 位姿差分获得,
|
| 15 |
+
质量按 PSIVG physics_mapping 的密度 × Genesis 计算体积。
|
| 16 |
+
"""
|
| 17 |
+
from __future__ import annotations
|
| 18 |
+
|
| 19 |
+
import argparse
|
| 20 |
+
import sys
|
| 21 |
+
from pathlib import Path
|
| 22 |
+
|
| 23 |
+
import numpy as np
|
| 24 |
+
|
| 25 |
+
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
| 26 |
+
import chain_common as cc
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def main() -> None:
|
| 30 |
+
ap = argparse.ArgumentParser()
|
| 31 |
+
ap.add_argument("--scene", required=True)
|
| 32 |
+
ap.add_argument("--sim", required=True)
|
| 33 |
+
ap.add_argument("--out", required=True)
|
| 34 |
+
args = ap.parse_args()
|
| 35 |
+
|
| 36 |
+
scene = cc.load_json(args.scene)
|
| 37 |
+
sim = np.load(Path(args.sim) / "sim.npz")
|
| 38 |
+
poses = np.asarray(sim["poses"], dtype=np.float64) # [F,O,4,4]
|
| 39 |
+
parts = np.asarray(sim["particles"], dtype=np.float64) # [F,N,3]
|
| 40 |
+
masses = np.asarray(sim["masses"], dtype=np.float64)
|
| 41 |
+
counts = np.asarray(sim["point_counts"], dtype=np.int64)
|
| 42 |
+
fps = float(np.asarray(sim["fps"]))
|
| 43 |
+
dt = 1.0 / fps
|
| 44 |
+
|
| 45 |
+
up = np.asarray(scene["ground"]["normal"], dtype=np.float64)
|
| 46 |
+
gp = np.asarray(scene["ground"]["point"], dtype=np.float64)
|
| 47 |
+
g = 9.81
|
| 48 |
+
|
| 49 |
+
n_frames = parts.shape[0]
|
| 50 |
+
# 粒子速度:中心差分(端点单侧)
|
| 51 |
+
vel = np.zeros_like(parts)
|
| 52 |
+
vel[1:-1] = (parts[2:] - parts[:-2]) / (2 * dt)
|
| 53 |
+
vel[0] = (parts[1] - parts[0]) / dt
|
| 54 |
+
vel[-1] = (parts[-1] - parts[-2]) / dt
|
| 55 |
+
|
| 56 |
+
ke, pe, ptot, etot = [], [], [], []
|
| 57 |
+
for t in range(n_frames):
|
| 58 |
+
v = vel[t]
|
| 59 |
+
x = parts[t]
|
| 60 |
+
vm = 0.0
|
| 61 |
+
mom = np.zeros(3)
|
| 62 |
+
off = 0
|
| 63 |
+
for j, n in enumerate(counts):
|
| 64 |
+
if masses[j] <= 0 or not np.isfinite(masses[j]):
|
| 65 |
+
off += n
|
| 66 |
+
continue
|
| 67 |
+
m_p = masses[j] / max(int(n), 1)
|
| 68 |
+
vm += 0.5 * m_p * float(np.sum(v[off:off + n] ** 2))
|
| 69 |
+
mom += m_p * v[off:off + n].sum(axis=0)
|
| 70 |
+
off += int(n)
|
| 71 |
+
h = (x - gp) @ up
|
| 72 |
+
pe_t = 0.0
|
| 73 |
+
off = 0
|
| 74 |
+
for j, n in enumerate(counts):
|
| 75 |
+
if masses[j] > 0 and np.isfinite(masses[j]):
|
| 76 |
+
m_p = masses[j] / max(int(n), 1)
|
| 77 |
+
pe_t += m_p * g * float(np.sum(h[off:off + n]))
|
| 78 |
+
off += int(n)
|
| 79 |
+
ke.append(vm)
|
| 80 |
+
pe.append(pe_t)
|
| 81 |
+
etot.append(vm + pe_t)
|
| 82 |
+
ptot.append(float(np.linalg.norm(mom)))
|
| 83 |
+
|
| 84 |
+
ke = np.asarray(ke)
|
| 85 |
+
pe = np.asarray(pe)
|
| 86 |
+
etot = np.asarray(etot)
|
| 87 |
+
ptot = np.asarray(ptot)
|
| 88 |
+
|
| 89 |
+
# (4) 能量预算:无外力时 E 不应增加
|
| 90 |
+
budget_violation = np.maximum(0.0, etot[1:] - etot[:-1])
|
| 91 |
+
# (6) 反弹越界
|
| 92 |
+
rebound_over = np.maximum(0.0, pe - pe[0])
|
| 93 |
+
|
| 94 |
+
out = Path(args.out)
|
| 95 |
+
out.mkdir(parents=True, exist_ok=True)
|
| 96 |
+
np.savez_compressed(out / "conservation.npz",
|
| 97 |
+
ke=ke, pe=pe, etot=etot, momentum=ptot,
|
| 98 |
+
energy_budget_violation=budget_violation,
|
| 99 |
+
rebound_over_release=rebound_over)
|
| 100 |
+
cc.dump_json(out / "conservation.json", {
|
| 101 |
+
"stage": "06_conservation",
|
| 102 |
+
"formulas": {
|
| 103 |
+
"E_k": "Σ ½ m ||v||²",
|
| 104 |
+
"E_p": "Σ m g (x - p_plane)·n_up",
|
| 105 |
+
"budget": "E(t+1) <= E(t) + W_ext, W_ext=0",
|
| 106 |
+
"momentum": "P = Σ m v",
|
| 107 |
+
"rebound_check": "E_p(t) - E_p(0)",
|
| 108 |
+
},
|
| 109 |
+
"source": "IMPACT 论文公式(无官方代码,链中唯一自实现步骤)",
|
| 110 |
+
"dt": dt,
|
| 111 |
+
"E0": float(etot[0]), "E_end": float(etot[-1]),
|
| 112 |
+
"E_drift_rel": float((etot[-1] - etot[0]) / max(abs(etot[0]), 1e-12)),
|
| 113 |
+
"max_budget_violation": float(budget_violation.max()) if budget_violation.size else 0.0,
|
| 114 |
+
"max_rebound_over_release": float(rebound_over.max()) if rebound_over.size else 0.0,
|
| 115 |
+
"momentum0": float(ptot[0]), "momentum_max": float(ptot.max()),
|
| 116 |
+
})
|
| 117 |
+
cc.log("06", f"E0={etot[0]:.3e} E_end={etot[-1]:.3e} "
|
| 118 |
+
f"drift={(etot[-1]-etot[0])/max(abs(etot[0]),1e-12):+.3%} "
|
| 119 |
+
f"max_violation={budget_violation.max() if budget_violation.size else 0:.3e}")
|
| 120 |
+
|
| 121 |
+
|
| 122 |
+
if __name__ == "__main__":
|
| 123 |
+
main()
|
pipeline_rigid/07_render_video/render_video.py
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
"""07_render_video/render_video.py — 粒子投影渲染成 mp4。
|
| 3 |
+
|
| 4 |
+
渲染口径对齐 PSIVG psivg/rendering/render_flow.py:把 3D 粒子按相机投影到
|
| 5 |
+
像素,按深度排序后逐点着色;背景用 OVOW 原视频帧(result.npz: video)以便
|
| 6 |
+
肉眼对齐"仿真粒子是否贴在真实物体上"。
|
| 7 |
+
|
| 8 |
+
输出:rigid_domino_sim.mp4(1280x720, H.264, yuv420p)+ preview.png
|
| 9 |
+
"""
|
| 10 |
+
from __future__ import annotations
|
| 11 |
+
|
| 12 |
+
import argparse
|
| 13 |
+
import colorsys
|
| 14 |
+
import subprocess
|
| 15 |
+
import sys
|
| 16 |
+
from pathlib import Path
|
| 17 |
+
|
| 18 |
+
import numpy as np
|
| 19 |
+
from PIL import Image, ImageDraw
|
| 20 |
+
|
| 21 |
+
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
| 22 |
+
import chain_common as cc
|
| 23 |
+
|
| 24 |
+
W, H = 1280, 720
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
def palette(n: int) -> list[tuple[int, int, int]]:
|
| 28 |
+
out = []
|
| 29 |
+
for i in range(n):
|
| 30 |
+
h = (i * 0.61803398875) % 1.0
|
| 31 |
+
r, g, b = colorsys.hsv_to_rgb(h, 0.85, 1.0)
|
| 32 |
+
out.append((int(r * 255), int(g * 255), int(b * 255)))
|
| 33 |
+
return out
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
def main() -> None:
|
| 37 |
+
ap = argparse.ArgumentParser()
|
| 38 |
+
ap.add_argument("--scene", required=True)
|
| 39 |
+
ap.add_argument("--sim", required=True)
|
| 40 |
+
ap.add_argument("--projected", required=True)
|
| 41 |
+
ap.add_argument("--out", required=True)
|
| 42 |
+
ap.add_argument("--ffmpeg", default="ffmpeg")
|
| 43 |
+
ap.add_argument("--max-frames", type=int, default=0)
|
| 44 |
+
args = ap.parse_args()
|
| 45 |
+
|
| 46 |
+
scene = cc.load_json(args.scene)
|
| 47 |
+
sim = np.load(Path(args.sim) / "sim.npz")
|
| 48 |
+
prj = np.load(Path(args.projected) / "projected.npz")
|
| 49 |
+
pix = np.asarray(prj["pix"], dtype=np.float64)
|
| 50 |
+
depth = np.asarray(prj["depth"], dtype=np.float64)
|
| 51 |
+
fidx = np.asarray(prj["frame_index"], dtype=np.int64)
|
| 52 |
+
|
| 53 |
+
counts = np.asarray(sim["point_counts"], dtype=np.int64)
|
| 54 |
+
names = [str(x) for x in np.asarray(sim["names"])]
|
| 55 |
+
fps = float(np.asarray(sim["fps"]))
|
| 56 |
+
|
| 57 |
+
n_frames = pix.shape[0] if not args.max_frames else min(int(args.max_frames),
|
| 58 |
+
pix.shape[0])
|
| 59 |
+
|
| 60 |
+
# 背景帧(OVOW 原视频,与位姿帧同频)
|
| 61 |
+
bg_path = Path(scene["source"]["run_dir"]) / "results" / "result.npz"
|
| 62 |
+
bg = None
|
| 63 |
+
if bg_path.exists():
|
| 64 |
+
video = np.load(bg_path)["video"] # [Fp,3,h,w]
|
| 65 |
+
video = np.asarray(video, dtype=np.float64)
|
| 66 |
+
if video.max() <= 1.5: # OVOW 存 0..1 浮点
|
| 67 |
+
video = video * 255.0
|
| 68 |
+
video = np.clip(video, 0, 255).astype(np.uint8)
|
| 69 |
+
bg = np.transpose(video, (0, 2, 3, 1)) # [Fp,h,w,3]
|
| 70 |
+
ih, iw = int(bg.shape[1]), int(bg.shape[2])
|
| 71 |
+
cc.log("07", f"背景视频帧 {bg.shape}")
|
| 72 |
+
else:
|
| 73 |
+
ih, iw = 560, 1008
|
| 74 |
+
sx, sy = W / iw, H / ih
|
| 75 |
+
|
| 76 |
+
Path(args.out).mkdir(parents=True, exist_ok=True)
|
| 77 |
+
|
| 78 |
+
colors = palette(len(names))
|
| 79 |
+
# 每个物体在粒子数组里的切片
|
| 80 |
+
slices, off = [], 0
|
| 81 |
+
for n in counts:
|
| 82 |
+
slices.append((off, off + int(n)))
|
| 83 |
+
off += int(n)
|
| 84 |
+
pidx = np.concatenate([np.full(b - a, k, dtype=np.int64)
|
| 85 |
+
for k, (a, b) in enumerate(slices)])
|
| 86 |
+
# 桌面是静态支撑面,不画粒子(否则盖住整幅画面)
|
| 87 |
+
skip = {k for k, n in enumerate(names) if n.startswith("table")}
|
| 88 |
+
|
| 89 |
+
# 相机焦距(像素),用于按物理半径换算屏幕半径
|
| 90 |
+
K = np.asarray(scene["camera"]["intrinsics"], dtype=np.float64)
|
| 91 |
+
fx = float(K[0][0, 0])
|
| 92 |
+
r_world = 0.006 # 粒子可视半径 6mm(骨牌尺寸 2-13cm)
|
| 93 |
+
|
| 94 |
+
proc = subprocess.Popen([
|
| 95 |
+
args.ffmpeg, "-y", "-loglevel", "error",
|
| 96 |
+
"-f", "rawvideo", "-pix_fmt", "rgb24", "-s", f"{W}x{H}", "-r", f"{fps:.3f}",
|
| 97 |
+
"-i", "-", "-an", "-c:v", "libx264", "-preset", "medium", "-crf", "20",
|
| 98 |
+
"-pix_fmt", "yuv420p", str(Path(args.out) / "rigid_domino_sim.mp4"),
|
| 99 |
+
], stdin=subprocess.PIPE)
|
| 100 |
+
|
| 101 |
+
for t in range(n_frames):
|
| 102 |
+
if bg is not None:
|
| 103 |
+
b = bg[min(int(fidx[t]), bg.shape[0] - 1)]
|
| 104 |
+
canvas = Image.fromarray(b).resize((W, H), Image.BILINEAR)
|
| 105 |
+
canvas = Image.blend(canvas, Image.new("RGB", (W, H), (0, 0, 0)), 0.45)
|
| 106 |
+
else:
|
| 107 |
+
canvas = Image.new("RGB", (W, H), (12, 12, 16))
|
| 108 |
+
draw = ImageDraw.Draw(canvas, "RGBA")
|
| 109 |
+
|
| 110 |
+
order = np.argsort(-depth[t]) # 远 → 近
|
| 111 |
+
for i in order:
|
| 112 |
+
if not np.isfinite(depth[t, i]) or depth[t, i] <= 1e-3:
|
| 113 |
+
continue
|
| 114 |
+
x, y = pix[t, i, 0] * sx, pix[t, i, 1] * sy
|
| 115 |
+
if not (0 <= x < W and 0 <= y < H):
|
| 116 |
+
continue
|
| 117 |
+
j = int(pidx[i])
|
| 118 |
+
if j in skip:
|
| 119 |
+
continue
|
| 120 |
+
r = float(np.clip(fx * r_world / depth[t, i], 1.0, 5.0))
|
| 121 |
+
draw.ellipse([x - r, y - r, x + r, y + r], fill=colors[j] + (210,))
|
| 122 |
+
|
| 123 |
+
# 进度条
|
| 124 |
+
draw.rectangle([0, H - 6, int(W * (t + 1) / n_frames), H], fill=(80, 200, 255, 255))
|
| 125 |
+
proc.stdin.write(np.asarray(canvas, dtype=np.uint8).tobytes())
|
| 126 |
+
if t == 0:
|
| 127 |
+
canvas.save(Path(args.out) / "preview.png")
|
| 128 |
+
if t % 20 == 0 or t == n_frames - 1:
|
| 129 |
+
cc.log("07", f"frame {t + 1}/{n_frames}")
|
| 130 |
+
|
| 131 |
+
proc.stdin.close()
|
| 132 |
+
proc.wait()
|
| 133 |
+
if proc.returncode != 0:
|
| 134 |
+
raise RuntimeError(f"ffmpeg 失败: {proc.returncode}")
|
| 135 |
+
cc.log("07", f"→ {Path(args.out)/'rigid_domino_sim.mp4'}")
|
| 136 |
+
|
| 137 |
+
|
| 138 |
+
if __name__ == "__main__":
|
| 139 |
+
main()
|
pipeline_rigid/__pycache__/chain_common.cpython-311.pyc
ADDED
|
Binary file (10.7 kB). View file
|
|
|
pipeline_rigid/chain_common.py
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
"""chain_common.py — rigid 链共享工具(仅编排,不含物理/采样算法)。
|
| 3 |
+
|
| 4 |
+
任何一步的算法都必须来自论文原代码:
|
| 5 |
+
OVOW engine/* → mesh + 6-DoF 位姿 + 相机
|
| 6 |
+
RAF genesis/utils/point_cloud.py → FPS 表面粒子
|
| 7 |
+
PSIVG psivg/simulation/physics_mapping.py → 材质→物理参数
|
| 8 |
+
PSIVG psivg/rendering/projection.py → 世界点→像素
|
| 9 |
+
IMPACT 论文公式 → 守恒台账(唯一无官方代码的部分)
|
| 10 |
+
"""
|
| 11 |
+
from __future__ import annotations
|
| 12 |
+
|
| 13 |
+
import json
|
| 14 |
+
import os
|
| 15 |
+
import sys
|
| 16 |
+
from pathlib import Path
|
| 17 |
+
|
| 18 |
+
import numpy as np
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
# --------------------------------------------------------------------------- #
|
| 22 |
+
# 配置
|
| 23 |
+
# --------------------------------------------------------------------------- #
|
| 24 |
+
def load_paths(cfg_path: str | Path) -> dict:
|
| 25 |
+
import yaml
|
| 26 |
+
with open(cfg_path, "r", encoding="utf-8") as f:
|
| 27 |
+
return yaml.safe_load(f)
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
def resolve_case_dir(case_glob: str) -> Path:
|
| 31 |
+
import glob
|
| 32 |
+
hits = sorted(glob.glob(case_glob))
|
| 33 |
+
if not hits:
|
| 34 |
+
raise FileNotFoundError(f"未找到 OVOW case: {case_glob}")
|
| 35 |
+
return Path(hits[0])
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
def resolve_run_dir(case_dir: Path) -> Path:
|
| 39 |
+
"""case_dir/video_pipeline_*/<video_name>/ 即 OVOW 的 run-dir。"""
|
| 40 |
+
vps = sorted(case_dir.glob("video_pipeline_*"))
|
| 41 |
+
if not vps:
|
| 42 |
+
raise FileNotFoundError(f"{case_dir} 下无 video_pipeline_*")
|
| 43 |
+
for sub in sorted(p for p in vps[-1].iterdir() if p.is_dir()):
|
| 44 |
+
if (sub / "objects").is_dir():
|
| 45 |
+
return sub
|
| 46 |
+
raise FileNotFoundError("run-dir 下无 objects/")
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
# --------------------------------------------------------------------------- #
|
| 50 |
+
# 落盘
|
| 51 |
+
# --------------------------------------------------------------------------- #
|
| 52 |
+
def json_default(obj):
|
| 53 |
+
if isinstance(obj, np.ndarray):
|
| 54 |
+
return obj.tolist()
|
| 55 |
+
if isinstance(obj, (np.floating, np.integer)):
|
| 56 |
+
return obj.item()
|
| 57 |
+
if isinstance(obj, Path):
|
| 58 |
+
return str(obj)
|
| 59 |
+
raise TypeError(type(obj))
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
def dump_json(path: str | Path, payload: dict, indent: int = 2) -> None:
|
| 63 |
+
Path(path).parent.mkdir(parents=True, exist_ok=True)
|
| 64 |
+
with open(path, "w", encoding="utf-8") as f:
|
| 65 |
+
json.dump(payload, f, indent=indent, ensure_ascii=False,
|
| 66 |
+
default=json_default)
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
def load_json(path: str | Path) -> dict:
|
| 70 |
+
with open(path, "r", encoding="utf-8") as f:
|
| 71 |
+
return json.load(f)
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
def log(stage: str, msg: str) -> None:
|
| 75 |
+
print(f"[{stage}] {msg}", flush=True)
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
# --------------------------------------------------------------------------- #
|
| 79 |
+
# 原代码加载(按文件路径导入,避免包 __init__ 的副作用)
|
| 80 |
+
# --------------------------------------------------------------------------- #
|
| 81 |
+
def import_file(module_name: str, file_path: str | Path):
|
| 82 |
+
import importlib.util
|
| 83 |
+
file_path = str(file_path)
|
| 84 |
+
if not os.path.exists(file_path):
|
| 85 |
+
raise FileNotFoundError(file_path)
|
| 86 |
+
spec = importlib.util.spec_from_file_location(module_name, file_path)
|
| 87 |
+
mod = importlib.util.module_from_spec(spec)
|
| 88 |
+
sys.modules[module_name] = mod
|
| 89 |
+
spec.loader.exec_module(mod)
|
| 90 |
+
return mod
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
# --------------------------------------------------------------------------- #
|
| 94 |
+
# 几何工具(编排层,非算法)
|
| 95 |
+
# --------------------------------------------------------------------------- #
|
| 96 |
+
def rotmat_to_quat_wxyz(R: np.ndarray) -> np.ndarray:
|
| 97 |
+
"""旋转矩阵 → 四元数 (w, x, y, z)(Genesis 用 wxyz)。"""
|
| 98 |
+
R = np.asarray(R, dtype=np.float64)
|
| 99 |
+
tr = float(np.trace(R))
|
| 100 |
+
if tr > 0:
|
| 101 |
+
s = np.sqrt(tr + 1.0) * 2
|
| 102 |
+
w = 0.25 * s
|
| 103 |
+
x = (R[2, 1] - R[1, 2]) / s
|
| 104 |
+
y = (R[0, 2] - R[2, 0]) / s
|
| 105 |
+
z = (R[1, 0] - R[0, 1]) / s
|
| 106 |
+
elif R[0, 0] > R[1, 1] and R[0, 0] > R[2, 2]:
|
| 107 |
+
s = np.sqrt(1.0 + R[0, 0] - R[1, 1] - R[2, 2]) * 2
|
| 108 |
+
w = (R[2, 1] - R[1, 2]) / s
|
| 109 |
+
x = 0.25 * s
|
| 110 |
+
y = (R[0, 1] + R[1, 0]) / s
|
| 111 |
+
z = (R[0, 2] + R[2, 0]) / s
|
| 112 |
+
elif R[1, 1] > R[2, 2]:
|
| 113 |
+
s = np.sqrt(1.0 + R[1, 1] - R[0, 0] - R[2, 2]) * 2
|
| 114 |
+
w = (R[0, 2] - R[2, 0]) / s
|
| 115 |
+
x = (R[0, 1] + R[1, 0]) / s
|
| 116 |
+
y = 0.25 * s
|
| 117 |
+
z = (R[1, 2] + R[2, 1]) / s
|
| 118 |
+
else:
|
| 119 |
+
s = np.sqrt(1.0 + R[2, 2] - R[0, 0] - R[1, 1]) * 2
|
| 120 |
+
w = (R[1, 0] - R[0, 1]) / s
|
| 121 |
+
x = (R[0, 2] + R[2, 0]) / s
|
| 122 |
+
y = (R[1, 2] + R[2, 1]) / s
|
| 123 |
+
z = 0.25 * s
|
| 124 |
+
q = np.array([w, x, y, z], dtype=np.float64)
|
| 125 |
+
return q / max(np.linalg.norm(q), 1e-12)
|
| 126 |
+
|
| 127 |
+
|
| 128 |
+
def log_map_so3(R: np.ndarray) -> np.ndarray:
|
| 129 |
+
"""SO(3) 对数映射 → 旋转向量(供由位姿差估计角速度)。"""
|
| 130 |
+
R = np.asarray(R, dtype=np.float64)
|
| 131 |
+
cos_t = np.clip((np.trace(R) - 1.0) / 2.0, -1.0, 1.0)
|
| 132 |
+
theta = float(np.arccos(cos_t))
|
| 133 |
+
if theta < 1e-8:
|
| 134 |
+
return np.zeros(3)
|
| 135 |
+
if abs(np.pi - theta) < 1e-6:
|
| 136 |
+
A = (R + np.eye(3)) / 2.0
|
| 137 |
+
axis = A[:, int(np.argmax(np.diag(A)))]
|
| 138 |
+
axis = axis / max(np.linalg.norm(axis), 1e-12)
|
| 139 |
+
return axis * theta
|
| 140 |
+
w = np.array([R[2, 1] - R[1, 2],
|
| 141 |
+
R[0, 2] - R[2, 0],
|
| 142 |
+
R[1, 0] - R[0, 1]], dtype=np.float64)
|
| 143 |
+
return w * (theta / (2.0 * np.sin(theta)))
|
| 144 |
+
|
| 145 |
+
|
| 146 |
+
def fit_plane(points: np.ndarray) -> tuple[np.ndarray, np.ndarray]:
|
| 147 |
+
"""最小二乘平面:返回 (质心, 单位法向)。"""
|
| 148 |
+
pts = np.asarray(points, dtype=np.float64)
|
| 149 |
+
c = pts.mean(axis=0)
|
| 150 |
+
_, _, vt = np.linalg.svd(pts - c, full_matrices=False)
|
| 151 |
+
n = vt[-1]
|
| 152 |
+
return c, n / max(np.linalg.norm(n), 1e-12)
|
pipeline_rigid/run_pipeline.py
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
"""run_pipeline.py — rigid 链编排(每步都是论文原代码的薄封装)。
|
| 3 |
+
|
| 4 |
+
01 OVOW mesh + 6-DoF 位姿 + 相机 → scene.json
|
| 5 |
+
02 RAF 官方 FPS 表面粒子化 → particles/
|
| 6 |
+
03 ViPE 光流(默认跳过,可 --flow 打开)
|
| 7 |
+
04 Genesis 刚体链式仿真 + PSIVG 材质映射 → sim.npz
|
| 8 |
+
05 PSIVG 世界点→像素投影 → projected.npz
|
| 9 |
+
06 IMPACT 守恒台账(公式,无官方码) → conservation.npz/json
|
| 10 |
+
07 render 粒子投影 → mp4 → rigid_domino_sim.mp4
|
| 11 |
+
|
| 12 |
+
用法(H100, conda PSIVG_env2):
|
| 13 |
+
python run_pipeline.py --paths 00_config/paths.yaml --tag rigid_v1
|
| 14 |
+
"""
|
| 15 |
+
from __future__ import annotations
|
| 16 |
+
|
| 17 |
+
import argparse
|
| 18 |
+
import subprocess
|
| 19 |
+
import sys
|
| 20 |
+
from pathlib import Path
|
| 21 |
+
|
| 22 |
+
HERE = Path(__file__).resolve().parent
|
| 23 |
+
sys.path.insert(0, str(HERE))
|
| 24 |
+
import chain_common as cc
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
def run(script: str, *argv: str) -> None:
|
| 28 |
+
cmd = [sys.executable, str(HERE / script), *argv]
|
| 29 |
+
cc.log("run", " ".join(cmd))
|
| 30 |
+
proc = subprocess.run(cmd)
|
| 31 |
+
if proc.returncode != 0:
|
| 32 |
+
raise SystemExit(f"stage 失败: {script} (exit {proc.returncode})")
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def main() -> None:
|
| 36 |
+
ap = argparse.ArgumentParser()
|
| 37 |
+
ap.add_argument("--paths", default=str(HERE / "00_config" / "paths.yaml"))
|
| 38 |
+
ap.add_argument("--tag", default="rigid_v1")
|
| 39 |
+
ap.add_argument("--n-points", type=int, default=400)
|
| 40 |
+
ap.add_argument("--steps", type=int, default=0, help="0=跟视频帧数")
|
| 41 |
+
ap.add_argument("--flow", action="store_true", help="启用 ViPE 光流阶段")
|
| 42 |
+
ap.add_argument("--ffmpeg", default="ffmpeg")
|
| 43 |
+
ap.add_argument("--from-stage", default="01")
|
| 44 |
+
args = ap.parse_args()
|
| 45 |
+
|
| 46 |
+
cfg = cc.load_paths(args.paths)
|
| 47 |
+
out = Path(cfg["runtime"]["out_root"]) / args.tag
|
| 48 |
+
out.mkdir(parents=True, exist_ok=True)
|
| 49 |
+
scene = str(out / "scene.json")
|
| 50 |
+
|
| 51 |
+
stages = {
|
| 52 |
+
"01": ("01_ovow_mesh_6dof/build_scene.py", ("--paths", args.paths, "--out", str(out))),
|
| 53 |
+
"02": ("02_raf_particles/particleize.py",
|
| 54 |
+
("--paths", args.paths, "--scene", scene, "--out", str(out),
|
| 55 |
+
"--n-points", str(args.n_points))),
|
| 56 |
+
"03": ("03_vipe_flow/run_vipe.py",
|
| 57 |
+
("--paths", args.paths, "--scene", scene, "--out", str(out))
|
| 58 |
+
+ (("--enable",) if args.flow else ())),
|
| 59 |
+
"04": ("04_psivg_sim/run_rigid_sim.py",
|
| 60 |
+
("--paths", args.paths, "--scene", scene, "--particles", str(out),
|
| 61 |
+
"--out", str(out), "--steps", str(args.steps))),
|
| 62 |
+
"05": ("05_projection_flow/project_particles.py",
|
| 63 |
+
("--paths", args.paths, "--scene", scene, "--sim", str(out), "--out", str(out))),
|
| 64 |
+
"06": ("06_conservation/conservation.py",
|
| 65 |
+
("--scene", scene, "--sim", str(out), "--out", str(out))),
|
| 66 |
+
"07": ("07_render_video/render_video.py",
|
| 67 |
+
("--scene", scene, "--sim", str(out), "--projected", str(out),
|
| 68 |
+
"--out", str(out), "--ffmpeg", args.ffmpeg)),
|
| 69 |
+
}
|
| 70 |
+
order = [k for k in ("01", "02", "03", "04", "05", "06", "07")
|
| 71 |
+
if k >= args.from_stage]
|
| 72 |
+
for k in order:
|
| 73 |
+
script, argv = stages[k]
|
| 74 |
+
run(script, *argv)
|
| 75 |
+
|
| 76 |
+
cc.dump_json(out / "run_manifest.json", {
|
| 77 |
+
"tag": args.tag,
|
| 78 |
+
"stages": {
|
| 79 |
+
"01_ovow_mesh_6dof": "OVOW batch_scene_pipeline 产物(scaled_mesh.obj + poses.json + result.npz)",
|
| 80 |
+
"02_raf_particles": "genesis.utils.point_cloud.sample_mesh_point_cloud(RAF 官方)",
|
| 81 |
+
"03_vipe_flow": "PSIVG psivg/perception/vipe(默认跳过)",
|
| 82 |
+
"04_psivg_sim": "genesis-world rigid solver + PSIVG physics_mapping.map_physical_params",
|
| 83 |
+
"05_projection_flow": "PSIVG psivg/rendering/projection.py::project",
|
| 84 |
+
"06_conservation": "IMPACT 论文公式(无官方代码)",
|
| 85 |
+
"07_render_video": "PSIVG render_flow 口径(深度排序点渲染)",
|
| 86 |
+
},
|
| 87 |
+
"output": str(out),
|
| 88 |
+
})
|
| 89 |
+
cc.log("run", f"完成 → {out}")
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
if __name__ == "__main__":
|
| 93 |
+
main()
|
pipeline_runs/rigid_v1/conservation.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"stage": "06_conservation",
|
| 3 |
+
"formulas": {
|
| 4 |
+
"E_k": "Σ ½ m ||v||²",
|
| 5 |
+
"E_p": "Σ m g (x - p_plane)·n_up",
|
| 6 |
+
"budget": "E(t+1) <= E(t) + W_ext, W_ext=0",
|
| 7 |
+
"momentum": "P = Σ m v",
|
| 8 |
+
"rebound_check": "E_p(t) - E_p(0)"
|
| 9 |
+
},
|
| 10 |
+
"source": "IMPACT 论文公式(无官方代码,链中唯一自实现步骤)",
|
| 11 |
+
"dt": 0.03333333333333333,
|
| 12 |
+
"E0": 0.061873290022667775,
|
| 13 |
+
"E_end": 0.009263115528226566,
|
| 14 |
+
"E_drift_rel": -0.8502889449577846,
|
| 15 |
+
"max_budget_violation": 0.00012750989178274622,
|
| 16 |
+
"max_rebound_over_release": 0.0,
|
| 17 |
+
"momentum0": 0.018113612465821494,
|
| 18 |
+
"momentum_max": 0.031071744628368904
|
| 19 |
+
}
|
pipeline_runs/rigid_v1/conservation.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ed6f6b55a0fa46f224ba422cc19a02aaceb9e9c04c6bfa810fd992438fc3cb69
|
| 3 |
+
size 4718
|
pipeline_runs/rigid_v1/flow_status.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"stage": "03_vipe_flow",
|
| 3 |
+
"entry": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/PSIVG/PSIVG/psivg/perception/vipe/run.py",
|
| 4 |
+
"video": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/videos_in/arrange_topple_dominoes__3.mp4",
|
| 5 |
+
"status": "skipped",
|
| 6 |
+
"reason": "rigid 渲染不依赖光流;未用自写光流顶替,保持口径干净"
|
| 7 |
+
}
|
pipeline_runs/rigid_v1/particles/domino_01.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0bdfcf6e847018d8eb9191f90e3be87068eccf851adc53bcf2fc441ba9b83ad4
|
| 3 |
+
size 5702
|
pipeline_runs/rigid_v1/particles/domino_02.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9de3840789760889ad51b269bd72c351de6bb5a2670ba6c1c5e27e026602bdab
|
| 3 |
+
size 5807
|
pipeline_runs/rigid_v1/particles/domino_03.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a01aecfeb58e61400c734233eedad6bfccf6bd4e4833bf5b71dde7017abac553
|
| 3 |
+
size 5671
|
pipeline_runs/rigid_v1/particles/domino_04.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:773302b27a4ec904341376b7ad5e6145bdd79ce8d6716bec771832053ab6dc38
|
| 3 |
+
size 5715
|
pipeline_runs/rigid_v1/particles/domino_05.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6a681c3ff2ab70defd7518d197342f9cac37f6ab26175a03cfc56bac5b441a00
|
| 3 |
+
size 5781
|
pipeline_runs/rigid_v1/particles/domino_06.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7dead91c931f529a4e588295b2cb7717fa5227fb56aefd31816470c095ea9d83
|
| 3 |
+
size 5753
|
pipeline_runs/rigid_v1/particles/domino_07.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:714fe1134a2212333aaf97eb8d2b7eee485fe3cd2b39b58d1d5f144848c05a80
|
| 3 |
+
size 5723
|
pipeline_runs/rigid_v1/particles/domino_08.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:836092ccaaa7189e206f3852f9590ff612df8089caec9266eb0084f2df860019
|
| 3 |
+
size 5680
|
pipeline_runs/rigid_v1/particles/domino_09.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4a9d5b5c1f6a6ea0bc58b027a2c1b8d353c368c2927ac90d065ef6e487967db7
|
| 3 |
+
size 5665
|
pipeline_runs/rigid_v1/particles/domino_10.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:25553299f4b98321ffd17a2d81e46a9d8bf9e32551a5cfa55080649093bb0e8a
|
| 3 |
+
size 5783
|
pipeline_runs/rigid_v1/particles/domino_11.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b6a682aab25e76d00ad8c76827a1b94209c14c8f6d135d213e69a6fcb83c29b0
|
| 3 |
+
size 5769
|
pipeline_runs/rigid_v1/particles/domino_12.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:85f1ed113c0749de0bef40f50093b5eba4d2111853dfcaa130d687a97de63fa3
|
| 3 |
+
size 5719
|
pipeline_runs/rigid_v1/particles/domino_13.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b283605758ced8a0bc492e8f0f6b0bcbd577d95c53c2d3346de08a6ea28ee1c3
|
| 3 |
+
size 5653
|
pipeline_runs/rigid_v1/particles/domino_14.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e74f1d9301d5a283796db5f90a57e1c6a83a546a2669435eebe19b63c8f69ace
|
| 3 |
+
size 5748
|
pipeline_runs/rigid_v1/particles/domino_15.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c5f3e0dabf2d31c6429a2bf8dde645d7c5e98cffdb8f606f01b06b6d6dd63cd3
|
| 3 |
+
size 5640
|
pipeline_runs/rigid_v1/particles/domino_16.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cddf5e8d7f1128dda8d43aff41c34b7dd2ef21a467a9b9162f212911066945b6
|
| 3 |
+
size 5671
|
pipeline_runs/rigid_v1/particles/domino_17.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c9caef440a7679bf96eb56d58d82eb4ab634d791aab023b600d4bb20e1c4c027
|
| 3 |
+
size 5721
|
pipeline_runs/rigid_v1/particles/hand_01.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8b883f67355f5277c0e81a5ef1f8478d8604eecbb57d5861f2fd00873d3c80e8
|
| 3 |
+
size 5705
|
pipeline_runs/rigid_v1/particles/index.json
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"stage": "02_raf_particles",
|
| 3 |
+
"sampler": "genesis.utils.point_cloud.sample_mesh_point_cloud (RAF 官方)",
|
| 4 |
+
"n_points_per_object": 400,
|
| 5 |
+
"objects": {
|
| 6 |
+
"domino_01": {
|
| 7 |
+
"n": 400,
|
| 8 |
+
"file": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs/rigid_v1/particles/domino_01.npz",
|
| 9 |
+
"source_mesh": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/ws/arrange_topple_dominoes__3_20261020_100901_64c3bf1b76a1/video_pipeline_20261020_101211/arrange_topple_dominoes__3/objects/domino_01/mid_files/scaled_mesh.obj"
|
| 10 |
+
},
|
| 11 |
+
"domino_02": {
|
| 12 |
+
"n": 400,
|
| 13 |
+
"file": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs/rigid_v1/particles/domino_02.npz",
|
| 14 |
+
"source_mesh": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/ws/arrange_topple_dominoes__3_20261020_100901_64c3bf1b76a1/video_pipeline_20261020_101211/arrange_topple_dominoes__3/objects/domino_02/mid_files/scaled_mesh.obj"
|
| 15 |
+
},
|
| 16 |
+
"domino_03": {
|
| 17 |
+
"n": 400,
|
| 18 |
+
"file": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs/rigid_v1/particles/domino_03.npz",
|
| 19 |
+
"source_mesh": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/ws/arrange_topple_dominoes__3_20261020_100901_64c3bf1b76a1/video_pipeline_20261020_101211/arrange_topple_dominoes__3/objects/domino_03/mid_files/scaled_mesh.obj"
|
| 20 |
+
},
|
| 21 |
+
"domino_04": {
|
| 22 |
+
"n": 400,
|
| 23 |
+
"file": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs/rigid_v1/particles/domino_04.npz",
|
| 24 |
+
"source_mesh": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/ws/arrange_topple_dominoes__3_20261020_100901_64c3bf1b76a1/video_pipeline_20261020_101211/arrange_topple_dominoes__3/objects/domino_04/mid_files/scaled_mesh.obj"
|
| 25 |
+
},
|
| 26 |
+
"domino_05": {
|
| 27 |
+
"n": 400,
|
| 28 |
+
"file": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs/rigid_v1/particles/domino_05.npz",
|
| 29 |
+
"source_mesh": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/ws/arrange_topple_dominoes__3_20261020_100901_64c3bf1b76a1/video_pipeline_20261020_101211/arrange_topple_dominoes__3/objects/domino_05/mid_files/scaled_mesh.obj"
|
| 30 |
+
},
|
| 31 |
+
"domino_06": {
|
| 32 |
+
"n": 400,
|
| 33 |
+
"file": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs/rigid_v1/particles/domino_06.npz",
|
| 34 |
+
"source_mesh": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/ws/arrange_topple_dominoes__3_20261020_100901_64c3bf1b76a1/video_pipeline_20261020_101211/arrange_topple_dominoes__3/objects/domino_06/mid_files/scaled_mesh.obj"
|
| 35 |
+
},
|
| 36 |
+
"domino_07": {
|
| 37 |
+
"n": 400,
|
| 38 |
+
"file": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs/rigid_v1/particles/domino_07.npz",
|
| 39 |
+
"source_mesh": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/ws/arrange_topple_dominoes__3_20261020_100901_64c3bf1b76a1/video_pipeline_20261020_101211/arrange_topple_dominoes__3/objects/domino_07/mid_files/scaled_mesh.obj"
|
| 40 |
+
},
|
| 41 |
+
"domino_08": {
|
| 42 |
+
"n": 400,
|
| 43 |
+
"file": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs/rigid_v1/particles/domino_08.npz",
|
| 44 |
+
"source_mesh": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/ws/arrange_topple_dominoes__3_20261020_100901_64c3bf1b76a1/video_pipeline_20261020_101211/arrange_topple_dominoes__3/objects/domino_08/mid_files/scaled_mesh.obj"
|
| 45 |
+
},
|
| 46 |
+
"domino_09": {
|
| 47 |
+
"n": 400,
|
| 48 |
+
"file": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs/rigid_v1/particles/domino_09.npz",
|
| 49 |
+
"source_mesh": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/ws/arrange_topple_dominoes__3_20261020_100901_64c3bf1b76a1/video_pipeline_20261020_101211/arrange_topple_dominoes__3/objects/domino_09/mid_files/scaled_mesh.obj"
|
| 50 |
+
},
|
| 51 |
+
"domino_10": {
|
| 52 |
+
"n": 400,
|
| 53 |
+
"file": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs/rigid_v1/particles/domino_10.npz",
|
| 54 |
+
"source_mesh": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/ws/arrange_topple_dominoes__3_20261020_100901_64c3bf1b76a1/video_pipeline_20261020_101211/arrange_topple_dominoes__3/objects/domino_10/mid_files/scaled_mesh.obj"
|
| 55 |
+
},
|
| 56 |
+
"domino_11": {
|
| 57 |
+
"n": 400,
|
| 58 |
+
"file": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs/rigid_v1/particles/domino_11.npz",
|
| 59 |
+
"source_mesh": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/ws/arrange_topple_dominoes__3_20261020_100901_64c3bf1b76a1/video_pipeline_20261020_101211/arrange_topple_dominoes__3/objects/domino_11/mid_files/scaled_mesh.obj"
|
| 60 |
+
},
|
| 61 |
+
"domino_12": {
|
| 62 |
+
"n": 400,
|
| 63 |
+
"file": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs/rigid_v1/particles/domino_12.npz",
|
| 64 |
+
"source_mesh": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/ws/arrange_topple_dominoes__3_20261020_100901_64c3bf1b76a1/video_pipeline_20261020_101211/arrange_topple_dominoes__3/objects/domino_12/mid_files/scaled_mesh.obj"
|
| 65 |
+
},
|
| 66 |
+
"domino_13": {
|
| 67 |
+
"n": 400,
|
| 68 |
+
"file": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs/rigid_v1/particles/domino_13.npz",
|
| 69 |
+
"source_mesh": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/ws/arrange_topple_dominoes__3_20261020_100901_64c3bf1b76a1/video_pipeline_20261020_101211/arrange_topple_dominoes__3/objects/domino_13/mid_files/scaled_mesh.obj"
|
| 70 |
+
},
|
| 71 |
+
"domino_14": {
|
| 72 |
+
"n": 400,
|
| 73 |
+
"file": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs/rigid_v1/particles/domino_14.npz",
|
| 74 |
+
"source_mesh": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/ws/arrange_topple_dominoes__3_20261020_100901_64c3bf1b76a1/video_pipeline_20261020_101211/arrange_topple_dominoes__3/objects/domino_14/mid_files/scaled_mesh.obj"
|
| 75 |
+
},
|
| 76 |
+
"domino_15": {
|
| 77 |
+
"n": 400,
|
| 78 |
+
"file": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs/rigid_v1/particles/domino_15.npz",
|
| 79 |
+
"source_mesh": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/ws/arrange_topple_dominoes__3_20261020_100901_64c3bf1b76a1/video_pipeline_20261020_101211/arrange_topple_dominoes__3/objects/domino_15/mid_files/scaled_mesh.obj"
|
| 80 |
+
},
|
| 81 |
+
"domino_16": {
|
| 82 |
+
"n": 400,
|
| 83 |
+
"file": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs/rigid_v1/particles/domino_16.npz",
|
| 84 |
+
"source_mesh": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/ws/arrange_topple_dominoes__3_20261020_100901_64c3bf1b76a1/video_pipeline_20261020_101211/arrange_topple_dominoes__3/objects/domino_16/mid_files/scaled_mesh.obj"
|
| 85 |
+
},
|
| 86 |
+
"domino_17": {
|
| 87 |
+
"n": 400,
|
| 88 |
+
"file": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs/rigid_v1/particles/domino_17.npz",
|
| 89 |
+
"source_mesh": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/ws/arrange_topple_dominoes__3_20261020_100901_64c3bf1b76a1/video_pipeline_20261020_101211/arrange_topple_dominoes__3/objects/domino_17/mid_files/scaled_mesh.obj"
|
| 90 |
+
},
|
| 91 |
+
"hand_01": {
|
| 92 |
+
"n": 400,
|
| 93 |
+
"file": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs/rigid_v1/particles/hand_01.npz",
|
| 94 |
+
"source_mesh": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/ws/arrange_topple_dominoes__3_20261020_100901_64c3bf1b76a1/video_pipeline_20261020_101211/arrange_topple_dominoes__3/objects/hand_01/mid_files/scaled_mesh.obj"
|
| 95 |
+
},
|
| 96 |
+
"table_01": {
|
| 97 |
+
"n": 400,
|
| 98 |
+
"file": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs/rigid_v1/particles/table_01.npz",
|
| 99 |
+
"source_mesh": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/OVOW/outputs/egodex_p2_batch/ws/arrange_topple_dominoes__3_20261020_100901_64c3bf1b76a1/video_pipeline_20261020_101211/arrange_topple_dominoes__3/objects/table_01/mid_files/scaled_mesh.obj"
|
| 100 |
+
}
|
| 101 |
+
}
|
| 102 |
+
}
|
pipeline_runs/rigid_v1/particles/table_01.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bc39ca3a79495d6984bb15b83d3f410c8dcebac61c4dc666466a74eb6e352931
|
| 3 |
+
size 5530
|
pipeline_runs/rigid_v1/preview.png
ADDED
|
Git LFS Details
|
pipeline_runs/rigid_v1/projected.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:847dfb378dda0efdfc4a3baaf534ee947da224d17a0b151eec905da8594f18c4
|
| 3 |
+
size 7311798
|
pipeline_runs/rigid_v1/projection_meta.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"stage": "05_projection_flow",
|
| 3 |
+
"projection": "PSIVG psivg/rendering/projection.py::project(extrinsics=camera-to-world)",
|
| 4 |
+
"n_sim_frames": 103,
|
| 5 |
+
"pose_stride": 3,
|
| 6 |
+
"image_size": [
|
| 7 |
+
560,
|
| 8 |
+
1008
|
| 9 |
+
]
|
| 10 |
+
}
|
pipeline_runs/rigid_v1/rigid_domino_sim.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:929a7d957bd30e4655c20abce0df2cc5d12e4c3653dbfffb48c2ca7d00bb77b3
|
| 3 |
+
size 596515
|
pipeline_runs/rigid_v1/run_manifest.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"tag": "rigid_v1",
|
| 3 |
+
"stages": {
|
| 4 |
+
"01_ovow_mesh_6dof": "OVOW batch_scene_pipeline 产物(scaled_mesh.obj + poses.json + result.npz)",
|
| 5 |
+
"02_raf_particles": "genesis.utils.point_cloud.sample_mesh_point_cloud(RAF 官方)",
|
| 6 |
+
"03_vipe_flow": "PSIVG psivg/perception/vipe(默认跳过)",
|
| 7 |
+
"04_psivg_sim": "genesis-world rigid solver + PSIVG physics_mapping.map_physical_params",
|
| 8 |
+
"05_projection_flow": "PSIVG psivg/rendering/projection.py::project",
|
| 9 |
+
"06_conservation": "IMPACT 论文公式(无官方代码)",
|
| 10 |
+
"07_render_video": "PSIVG render_flow 口径(深度排序点渲染)"
|
| 11 |
+
},
|
| 12 |
+
"output": "/mnt/einsia/aws01-nvme/einsia-shared/homes/gaomingju/jiayin/pipeline_runs/rigid_v1"
|
| 13 |
+
}
|
pipeline_runs/rigid_v1/scene.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
pipeline_runs/rigid_v1/sim.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e26f52267af3f4eca47ad2e0595ba6a77be16e7bcda8f8a5e9092783dae26ef9
|
| 3 |
+
size 16970024
|
pipeline_runs/rigid_v1/sim_meta.json
ADDED
|
@@ -0,0 +1,352 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"stage": "04_psivg_sim",
|
| 3 |
+
"solver": "genesis-world rigid solver(RAF 官方刚体求解器)",
|
| 4 |
+
"why_not_psivg_mpm": "PSIVG MPM 入口仅支持 primary+secondary 两体旋转冲击场景,无法表达 17 块骨牌链式接触",
|
| 5 |
+
"dt": 0.03333333333333333,
|
| 6 |
+
"substeps": 4,
|
| 7 |
+
"n_steps": 102,
|
| 8 |
+
"gravity": [
|
| 9 |
+
-2.2455882433816328,
|
| 10 |
+
9.184568974262227,
|
| 11 |
+
2.6147898956141544
|
| 12 |
+
],
|
| 13 |
+
"ground_point": [
|
| 14 |
+
-0.13459727822376052,
|
| 15 |
+
0.12027125967405874,
|
| 16 |
+
0.5815868384692058
|
| 17 |
+
],
|
| 18 |
+
"ground_normal": [
|
| 19 |
+
0.22890807781668018,
|
| 20 |
+
-0.9362455631256092,
|
| 21 |
+
-0.2665433124988944
|
| 22 |
+
],
|
| 23 |
+
"objects": [
|
| 24 |
+
{
|
| 25 |
+
"name": "domino_01",
|
| 26 |
+
"kind": "domino",
|
| 27 |
+
"density": 700.0,
|
| 28 |
+
"friction": 0.5,
|
| 29 |
+
"restitution": 0.15,
|
| 30 |
+
"v0": [
|
| 31 |
+
0.05490161414914268,
|
| 32 |
+
0.03507910966551578,
|
| 33 |
+
-0.013226314048038201
|
| 34 |
+
],
|
| 35 |
+
"omega0": [
|
| 36 |
+
-0.26291788424567936,
|
| 37 |
+
-0.5168495727374846,
|
| 38 |
+
-0.31884267326186244
|
| 39 |
+
]
|
| 40 |
+
},
|
| 41 |
+
{
|
| 42 |
+
"name": "domino_02",
|
| 43 |
+
"kind": "domino",
|
| 44 |
+
"density": 700.0,
|
| 45 |
+
"friction": 0.5,
|
| 46 |
+
"restitution": 0.15,
|
| 47 |
+
"v0": [
|
| 48 |
+
0.026376879788881924,
|
| 49 |
+
0.011466225474770497,
|
| 50 |
+
-0.02204551349435757
|
| 51 |
+
],
|
| 52 |
+
"omega0": [
|
| 53 |
+
0.09452901541621,
|
| 54 |
+
-0.657849778798883,
|
| 55 |
+
0.09161182209133438
|
| 56 |
+
]
|
| 57 |
+
},
|
| 58 |
+
{
|
| 59 |
+
"name": "domino_03",
|
| 60 |
+
"kind": "domino",
|
| 61 |
+
"density": 700.0,
|
| 62 |
+
"friction": 0.5,
|
| 63 |
+
"restitution": 0.15,
|
| 64 |
+
"v0": [
|
| 65 |
+
0.009270366041536499,
|
| 66 |
+
0.01523195773027175,
|
| 67 |
+
-0.07905231519336309
|
| 68 |
+
],
|
| 69 |
+
"omega0": [
|
| 70 |
+
1.4906302012954058,
|
| 71 |
+
-1.1883683400218976,
|
| 72 |
+
1.1411518357205714
|
| 73 |
+
]
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"name": "domino_04",
|
| 77 |
+
"kind": "domino",
|
| 78 |
+
"density": 700.0,
|
| 79 |
+
"friction": 0.5,
|
| 80 |
+
"restitution": 0.15,
|
| 81 |
+
"v0": [
|
| 82 |
+
0.04354475494994181,
|
| 83 |
+
0.0048259560660202094,
|
| 84 |
+
-0.004963385693098621
|
| 85 |
+
],
|
| 86 |
+
"omega0": [
|
| 87 |
+
-0.33266753574668323,
|
| 88 |
+
0.38226022121270803,
|
| 89 |
+
-0.08871091245336472
|
| 90 |
+
]
|
| 91 |
+
},
|
| 92 |
+
{
|
| 93 |
+
"name": "domino_05",
|
| 94 |
+
"kind": "domino",
|
| 95 |
+
"density": 700.0,
|
| 96 |
+
"friction": 0.5,
|
| 97 |
+
"restitution": 0.15,
|
| 98 |
+
"v0": [
|
| 99 |
+
0.03545163365058114,
|
| 100 |
+
0.0011729632564530523,
|
| 101 |
+
-0.01517236196396321
|
| 102 |
+
],
|
| 103 |
+
"omega0": [
|
| 104 |
+
-0.8739600251476043,
|
| 105 |
+
-0.02631764290693659,
|
| 106 |
+
0.47882254035904337
|
| 107 |
+
]
|
| 108 |
+
},
|
| 109 |
+
{
|
| 110 |
+
"name": "domino_06",
|
| 111 |
+
"kind": "domino",
|
| 112 |
+
"density": 700.0,
|
| 113 |
+
"friction": 0.5,
|
| 114 |
+
"restitution": 0.15,
|
| 115 |
+
"v0": [
|
| 116 |
+
-0.019121995925973356,
|
| 117 |
+
-0.007653441939306366,
|
| 118 |
+
-0.05150107568547502
|
| 119 |
+
],
|
| 120 |
+
"omega0": [
|
| 121 |
+
0.4219893272622916,
|
| 122 |
+
0.15861151087194006,
|
| 123 |
+
-0.678478890884284
|
| 124 |
+
]
|
| 125 |
+
},
|
| 126 |
+
{
|
| 127 |
+
"name": "domino_07",
|
| 128 |
+
"kind": "domino",
|
| 129 |
+
"density": 700.0,
|
| 130 |
+
"friction": 0.5,
|
| 131 |
+
"restitution": 0.15,
|
| 132 |
+
"v0": [
|
| 133 |
+
0.04009441487154153,
|
| 134 |
+
0.01070696544155203,
|
| 135 |
+
-0.04283106894196864
|
| 136 |
+
],
|
| 137 |
+
"omega0": [
|
| 138 |
+
1.3268535994768618,
|
| 139 |
+
-0.4028126199580742,
|
| 140 |
+
0.6620653953176782
|
| 141 |
+
]
|
| 142 |
+
},
|
| 143 |
+
{
|
| 144 |
+
"name": "domino_08",
|
| 145 |
+
"kind": "domino",
|
| 146 |
+
"density": 700.0,
|
| 147 |
+
"friction": 0.5,
|
| 148 |
+
"restitution": 0.15,
|
| 149 |
+
"v0": [
|
| 150 |
+
0.034287878623695395,
|
| 151 |
+
0.0071308761617175365,
|
| 152 |
+
-0.0032748573583085694
|
| 153 |
+
],
|
| 154 |
+
"omega0": [
|
| 155 |
+
0.1861033795859077,
|
| 156 |
+
-0.5383303383207735,
|
| 157 |
+
-0.8132905212057798
|
| 158 |
+
]
|
| 159 |
+
},
|
| 160 |
+
{
|
| 161 |
+
"name": "domino_09",
|
| 162 |
+
"kind": "domino",
|
| 163 |
+
"density": 700.0,
|
| 164 |
+
"friction": 0.5,
|
| 165 |
+
"restitution": 0.15,
|
| 166 |
+
"v0": [
|
| 167 |
+
-0.010876775456685889,
|
| 168 |
+
-0.026047038070420303,
|
| 169 |
+
0.025961432556370623
|
| 170 |
+
],
|
| 171 |
+
"omega0": [
|
| 172 |
+
-0.10886406905140616,
|
| 173 |
+
0.7553551065025624,
|
| 174 |
+
-1.2030407955748665
|
| 175 |
+
]
|
| 176 |
+
},
|
| 177 |
+
{
|
| 178 |
+
"name": "domino_10",
|
| 179 |
+
"kind": "domino",
|
| 180 |
+
"density": 700.0,
|
| 181 |
+
"friction": 0.5,
|
| 182 |
+
"restitution": 0.15,
|
| 183 |
+
"v0": [
|
| 184 |
+
0.009382802465360413,
|
| 185 |
+
-0.0019693163860955154,
|
| 186 |
+
0.014562762286663977
|
| 187 |
+
],
|
| 188 |
+
"omega0": [
|
| 189 |
+
0.5054544573467945,
|
| 190 |
+
3.1532008674887013,
|
| 191 |
+
0.6162896958834453
|
| 192 |
+
]
|
| 193 |
+
},
|
| 194 |
+
{
|
| 195 |
+
"name": "domino_11",
|
| 196 |
+
"kind": "domino",
|
| 197 |
+
"density": 700.0,
|
| 198 |
+
"friction": 0.5,
|
| 199 |
+
"restitution": 0.15,
|
| 200 |
+
"v0": [
|
| 201 |
+
-0.08580527486380693,
|
| 202 |
+
-0.029403802866560524,
|
| 203 |
+
-0.03493104793510171
|
| 204 |
+
],
|
| 205 |
+
"omega0": [
|
| 206 |
+
0.3401726878941825,
|
| 207 |
+
-0.1881627038345335,
|
| 208 |
+
0.1824955850566193
|
| 209 |
+
]
|
| 210 |
+
},
|
| 211 |
+
{
|
| 212 |
+
"name": "domino_12",
|
| 213 |
+
"kind": "domino",
|
| 214 |
+
"density": 700.0,
|
| 215 |
+
"friction": 0.5,
|
| 216 |
+
"restitution": 0.15,
|
| 217 |
+
"v0": [
|
| 218 |
+
0.03383767917369995,
|
| 219 |
+
0.01036168653650485,
|
| 220 |
+
0.03569276292952228
|
| 221 |
+
],
|
| 222 |
+
"omega0": [
|
| 223 |
+
-0.720773247371285,
|
| 224 |
+
0.7532045797821436,
|
| 225 |
+
-1.294772772762104
|
| 226 |
+
]
|
| 227 |
+
},
|
| 228 |
+
{
|
| 229 |
+
"name": "domino_13",
|
| 230 |
+
"kind": "domino",
|
| 231 |
+
"density": 700.0,
|
| 232 |
+
"friction": 0.5,
|
| 233 |
+
"restitution": 0.15,
|
| 234 |
+
"v0": [
|
| 235 |
+
0.012428678370506319,
|
| 236 |
+
0.013968901564341968,
|
| 237 |
+
0.013897681826300357
|
| 238 |
+
],
|
| 239 |
+
"omega0": [
|
| 240 |
+
0.378061065423109,
|
| 241 |
+
-0.1917588098185813,
|
| 242 |
+
0.21452212036716756
|
| 243 |
+
]
|
| 244 |
+
},
|
| 245 |
+
{
|
| 246 |
+
"name": "domino_14",
|
| 247 |
+
"kind": "domino",
|
| 248 |
+
"density": 700.0,
|
| 249 |
+
"friction": 0.5,
|
| 250 |
+
"restitution": 0.15,
|
| 251 |
+
"v0": [
|
| 252 |
+
0.03397460211929088,
|
| 253 |
+
-0.007497715651701292,
|
| 254 |
+
-0.04381392890695057
|
| 255 |
+
],
|
| 256 |
+
"omega0": [
|
| 257 |
+
0.17937862547878247,
|
| 258 |
+
0.1395689638825784,
|
| 259 |
+
-0.2301604520405201
|
| 260 |
+
]
|
| 261 |
+
},
|
| 262 |
+
{
|
| 263 |
+
"name": "domino_15",
|
| 264 |
+
"kind": "domino",
|
| 265 |
+
"density": 700.0,
|
| 266 |
+
"friction": 0.5,
|
| 267 |
+
"restitution": 0.15,
|
| 268 |
+
"v0": [
|
| 269 |
+
0.018578038654642054,
|
| 270 |
+
0.022675569902498097,
|
| 271 |
+
0.08540343834646524
|
| 272 |
+
],
|
| 273 |
+
"omega0": [
|
| 274 |
+
-0.8252111970390458,
|
| 275 |
+
-0.3743482996906928,
|
| 276 |
+
0.491894179455349
|
| 277 |
+
]
|
| 278 |
+
},
|
| 279 |
+
{
|
| 280 |
+
"name": "domino_16",
|
| 281 |
+
"kind": "domino",
|
| 282 |
+
"density": 700.0,
|
| 283 |
+
"friction": 0.5,
|
| 284 |
+
"restitution": 0.15,
|
| 285 |
+
"v0": [
|
| 286 |
+
0.01424962158272508,
|
| 287 |
+
-0.009865332288929302,
|
| 288 |
+
0.01479356410654109
|
| 289 |
+
],
|
| 290 |
+
"omega0": [
|
| 291 |
+
-0.3796065623596016,
|
| 292 |
+
0.21059179346903956,
|
| 293 |
+
0.19400548517862418
|
| 294 |
+
]
|
| 295 |
+
},
|
| 296 |
+
{
|
| 297 |
+
"name": "domino_17",
|
| 298 |
+
"kind": "domino",
|
| 299 |
+
"density": 700.0,
|
| 300 |
+
"friction": 0.5,
|
| 301 |
+
"restitution": 0.15,
|
| 302 |
+
"v0": [
|
| 303 |
+
0.013476602332338633,
|
| 304 |
+
0.034493927024326076,
|
| 305 |
+
-0.07264116975496226
|
| 306 |
+
],
|
| 307 |
+
"omega0": [
|
| 308 |
+
1.2435362916400983,
|
| 309 |
+
-0.4966930896866402,
|
| 310 |
+
0.4361689358393695
|
| 311 |
+
]
|
| 312 |
+
},
|
| 313 |
+
{
|
| 314 |
+
"name": "table_01",
|
| 315 |
+
"kind": "table",
|
| 316 |
+
"density": 700.0,
|
| 317 |
+
"friction": 0.3,
|
| 318 |
+
"restitution": 0.15,
|
| 319 |
+
"v0": [
|
| 320 |
+
0.0,
|
| 321 |
+
0.0,
|
| 322 |
+
0.0
|
| 323 |
+
],
|
| 324 |
+
"omega0": [
|
| 325 |
+
0.0,
|
| 326 |
+
0.0,
|
| 327 |
+
0.0
|
| 328 |
+
]
|
| 329 |
+
}
|
| 330 |
+
],
|
| 331 |
+
"mass": [
|
| 332 |
+
0.006107794418656363,
|
| 333 |
+
0.01842042787774885,
|
| 334 |
+
0.005025224769111301,
|
| 335 |
+
0.018376240698299542,
|
| 336 |
+
0.005492886424746557,
|
| 337 |
+
0.0073242506816646805,
|
| 338 |
+
0.007998789945059185,
|
| 339 |
+
0.004790675535738882,
|
| 340 |
+
0.015512341847769683,
|
| 341 |
+
0.006426325639179595,
|
| 342 |
+
0.009090232049679355,
|
| 343 |
+
0.008674602913994762,
|
| 344 |
+
0.005000330959867743,
|
| 345 |
+
0.01482801699636959,
|
| 346 |
+
0.004041769788527677,
|
| 347 |
+
0.011889596230691446,
|
| 348 |
+
0.007634731021070889,
|
| 349 |
+
1.1920928955078125e-07
|
| 350 |
+
],
|
| 351 |
+
"physics_mapping": "PSIVG psivg/simulation/physics_mapping.py::map_physical_params"
|
| 352 |
+
}
|
upvg/exp2_out/ctrl_field.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cd57a126565ed5c95f4abdb463a3807a13fffe98950c08eee990b54f67112668
|
| 3 |
+
size 13926
|
upvg/exp2_out/first_frame.png
ADDED
|
Git LFS Details
|
upvg/exp2_out/flow_frames/f000.png
ADDED
|
Git LFS Details
|
upvg/exp2_out/flow_frames/f001.png
ADDED
|
Git LFS Details
|
upvg/exp2_out/flow_frames/f002.png
ADDED
|
Git LFS Details
|
upvg/exp2_out/flow_frames/f003.png
ADDED
|
Git LFS Details
|
upvg/exp2_out/flow_frames/f004.png
ADDED
|
Git LFS Details
|
upvg/exp2_out/flow_frames/f005.png
ADDED
|
Git LFS Details
|