Datasets:
Download scripts/prepare_procedural.py from perpetual-research/splatbench: direct link, hf CLI and curl.
- Browser
- Download file 1.25 kB
-
https://huggingface.co/datasets/perpetual-research/splatbench/resolve/main/scripts/prepare_procedural.py
- Command line
-
hf download hf://datasets/perpetual-research/splatbench/scripts/prepare_procedural.py
-
curl -L -o prepare_procedural.py https://huggingface.co/datasets/perpetual-research/splatbench/resolve/main/scripts/prepare_procedural.py
1.25 kB
| """Rebuild the procedural objects of the task set (snowman, mushroom, table, rocket, tree, robot). | |
| uv run python scripts/prepare_procedural.py | |
| For each object: renders the 8 reference and 8 held-out views, fits the 300- and 64-Gaussian gradient-descent | |
| references, scrambles the 300-Gaussian fit into six parts for the reassembly task and writes both task files. | |
| """ | |
| import argparse | |
| import sys | |
| from splatbench.prep import prepare_scene | |
| from splatbench.procedural import NAMED_SCENES, build_named | |
| from splatbench.scene import scene_from_gaussians | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument("--out", default="data/bench") | |
| ap.add_argument("--names", nargs="*", default=list(NAMED_SCENES)) | |
| ap.add_argument("--iters", type=int, default=2000) | |
| ap.add_argument("--device", default="cuda") | |
| a = ap.parse_args() | |
| for name in a.names: | |
| gs, parts = build_named(name, device=a.device) | |
| sc = scene_from_gaussians(name, gs, res=256, radius=3.8, | |
| meta=dict(tier="primitives", source="procedural (splatbench.procedural)", | |
| parts=[p[0] for p in parts])) | |
| prepare_scene(sc, a.out, iters=a.iters, device=a.device, log=lambda s: print(s, flush=True)) | |
| print("done", file=sys.stderr) | |