enviably9625's picture
Upload folder using huggingface_hub (part 2)
acdc230 verified
Raw History Blame Contribute Delete
938 Bytes
import os
import tomllib
import math
scenes = ["bridge", "crane", "office_dynamic", "glass_house", "old_house", "unfinished_build", "ship"]
for scene in scenes:
os.system(
f"blender -b {scene}/{scene}.blend -P export_unordered_cams.py -- {scene}"
)
with open(f"{scene}/scene_data.toml", "rb") as f:
data = tomllib.load(f)
scene_data = data["scene_data"]
offset_dict = data['traj2offset']
offsets = offset_dict.values()
for offset in offsets:
if math.isnan(offset):
continue
indir = f"{scene}/unordered_cams/traj=proxy_surface_{offset}"
outdir = f"{scene}/cam_order/traj=proxy_surface_{offset}"
os.makedirs(outdir, exist_ok=True)
os.system(
"python tsp_solver.py " + indir + " " +
outdir + '/splatworks_cam_order.txt'
)
os.system(
f"blender -b {scene}/{scene}.blend -P render_scene.py"
)