FORGE3DBench rest658: held-out views (all non-input cameras with visibility), index, wrapper, README addendum
2c0472d verified Download forgebench/code/eval/build_heldout_index_rest658.py from Ronaldo-GOAT/bert_simpson: direct link, hf CLI and curl.
- Browser
- Download file 1.85 kB
-
https://huggingface.co/Ronaldo-GOAT/bert_simpson/resolve/main/forgebench/code/eval/build_heldout_index_rest658.py
- Command line
-
hf download hf://Ronaldo-GOAT/bert_simpson/forgebench/code/eval/build_heldout_index_rest658.py
-
curl -L -o build_heldout_index_rest658.py https://huggingface.co/Ronaldo-GOAT/bert_simpson/resolve/main/forgebench/code/eval/build_heldout_index_rest658.py
1.85 kB
| #!/usr/bin/env python3 | |
| """Portable held-out (NV) index for FORGE3DBench rest-658 (copy of the FB150 branch of build_heldout_index.py). | |
| Input : heldout_rest658.json (absolute-path index written by prepare_heldout_rest658.py; schema of heldout_fb150.json) | |
| Output: heldout_index/heldout_rest658.json = {object: [{tag, cam, vis, px, px_ok, files, src: "heldout", kind: "heldout"}, ...]} | |
| = ALL 20 non-input scene cams per object (13,160 records); files=False -> empty modal mask, no png/npz | |
| (files live in data/rest658_heldout.tar.gz.part* -> rest658_heldout/{inputs,renders}) | |
| No record is filtered here; the protocol filter (vis >= --min-vis 0.2, px >= --min-px 400, files) is applied by | |
| eval_rest658_wrapper.py at run time. | |
| """ | |
| import argparse, json | |
| from pathlib import Path | |
| def main(): | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument("--src", type=Path, default=Path("/lp-dev/jonghoon/mv-mesh/.debug/hub_rest658_heldout/heldout_rest658.json")) | |
| ap.add_argument("--out", type=Path, default=Path(__file__).resolve().parent / "heldout_index") | |
| a = ap.parse_args() | |
| a.out.mkdir(parents=True, exist_ok=True) | |
| fb = json.loads(a.src.read_text()) | |
| d = {o: [dict(tag=r["tag"], cam=r["cam"], vis=r["vis"], px=r["px"], px_ok=r["px_ok"], files=r["files"], | |
| src="heldout", kind="heldout") for r in v] | |
| for o, v in fb.items()} | |
| (a.out / "heldout_rest658.json").write_text(json.dumps(d, separators=(",", ":"))) | |
| n = [len(v) for v in d.values()] | |
| print("rest658 objects", len(d), "records", sum(n), "min/obj", min(n)) | |
| v = [len([r for r in x if r["vis"] >= 0.2 and r["px"] >= 400 and r["files"]]) for x in d.values()] | |
| print("rest658 protocol (vis>=0.20 & px>=400): records", sum(v), "min/obj", min(v), "objs with 0:", sum(x == 0 for x in v)) | |
| if __name__ == "__main__": | |
| main() | |