Archive CaveWorld3D project files · 1
Browse filesFiles changed (12)
- .gitattributes+4
- archive/file-index.jsonl.gzAdded+3
- archive/inventory.jsonAdded+33
- archive/restore-check.jsonAdded+26
- archive/restore.pyAdded+118
- code/history/CaveWorld3D.bundleAdded+3
- code/history/refs.jsonAdded+14
- code/history/verification.jsonAdded+22
- code/upstream-patches/HY-World-2.0.patchAdded+3
- code/upstream-patches/HY-World-2.0/run_hypano_worldstereo_baselines.pyAdded+84
- code/upstream-patches/HunyuanWorld-Voyager.patchAdded+3
- code/upstream-patches/revisions.jsonAdded+3
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353637383932 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textcode/history/CaveWorld3D.bundle filter=lfs diff=lfs merge=lfs -textcode/upstream-patches/HY-World-2.0.patch filter=lfs diff=lfs merge=lfs -textcode/upstream-patches/HunyuanWorld-Voyager.patch filter=lfs diff=lfs merge=lfs -textcode/upstream-patches/revisions.json filter=lfs diff=lfs merge=lfs -text
123version https://git-lfs.github.com/spec/v1oid sha256:1bf1a0c4dd6e5711bc7888a9cc02b0115b82b3f3c9152f4f44818819398493f3size 3708704123456789101112131415161718192021222324252627282930313233{ "repository": "xiaojie06/CaveWorld3D", "sources": { "dataset": 4690, "github": 220, "legacy": 24, "patches": 4, "persistent": 3050, "runs": 57278, "workspace": 4900 }, "source_file_paths": 70166, "source_file_bytes": 101673761420, "unique_payloads": 48351, "unique_payload_bytes": 78687469599, "symlinks": 376, "server_run_directories": 21, "github_releases": 7, "github_release_assets": 220, "raw_photos": 50, "raw_videos": 11, "direct_file_paths": 5983, "native_checkpoint_content_hashes": 162, "planned_archive_shards": 153, "archive_shard_uncompressed_bytes": 57568893538, "source_date": "2026-12-01", "excluded": "Unmodified third-party weights and installed runtimes are referenced. OS metadata, version-control internals, and bytecode are excluded. Code history is provided separately.", "archive_shard_compressed_bytes": 38878453957, "git_history_bytes": 199976314, "git_commits": 72, "git_heads": 5, "git_tags": 7}1234567891011121314151617181920212223242526{ "checked_original_source_paths": [ "workspace/scripts/outpaint_cave_photo.py", "runs/CaveWorld3D_photo_outpaint_39gh219p/cache/renders/all61/516/143/IMG_20261011_135530_00000_0/guided.png", "dataset/outputs/CaveWorld3D-material-20261130/wall_lights.json" ], "restored_payloads": [ { "path": "workspace/scripts/outpaint_cave_photo.py", "sha256": "2a2c6e6289b2ca610d7ee3f30e54f8a600bac47160a3d4155ee1c07e8682ef01" }, { "path": "runs/CaveWorld3D_photo_outpaint_39gh219p/cache/renders/all61/516/143/IMG_20261011_135530_00000_0/guided.png", "sha256": "75f218ac618702efc1321d480df25952d3cb029d94cba7166bbf30eac140c04e" }, { "path": "runs/CaveWorld3D_material_20261130_KBR3bisG/wall_lights.json", "sha256": "e412a0f9aabaca1de72cb62a931d1257f294e8d9f30a3680291dd3b23414fafc" } ], "symbolic_link": { "path": "dataset/outputs/CaveWorld3D-material-20261130/wall_lights.json", "target": "runs/CaveWorld3D_material_20261130_KBR3bisG/wall_lights.json" }, "matched": true}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118"""Restore an original CaveWorld3D path, subtree or complete snapshot from a pinned Hub revision."""import argparseimport gzipimport hashlibimport jsonimport osfrom pathlib import Path, PurePosixPathimport shutilimport subprocessimport tarfileimport tempfilefrom collections import defaultdict
REPOSITORY = 'xiaojie06/CaveWorld3D'def relative(name): p=PurePosixPath(name) if p.is_absolute() or any(v in ('..','.','') for v in p.parts): raise ValueError('Unsafe archive path '+name) return Path(*p.parts)def check(path,sha): h=hashlib.sha256() with path.open('rb') as f: for b in iter(lambda:f.read(2**20),b''):h.update(b) return h.hexdigest()==shadef materialize(dst,stream,row): if dst.exists(): if dst.is_file() and check(dst,row['sha256']):return raise FileExistsError('A different file already exists at '+str(dst)) dst.parent.mkdir(parents=True,exist_ok=True) part=None try: with tempfile.NamedTemporaryFile(dir=dst.parent,delete=False) as out: part=Path(out.name);h=hashlib.sha256();length=0 for b in iter(lambda:stream.read(2**20),b''): length+=len(b);h.update(b);out.write(b) if length!=row['bytes'] or h.hexdigest()!=row['sha256']: raise ValueError('Payload hash or size mismatch for '+row['path']) part.chmod(row['mode']);os.link(part,dst) finally: if part is not None:part.unlink(missing_ok=True)def select(name,prefixes): return not prefixes or any(name==p or name.startswith(p.rstrip('/')+'/') for p in prefixes)def main(): ap=argparse.ArgumentParser(description=__doc__) ap.add_argument('--out',type=Path,required=True) ap.add_argument('--prefix',action='append',default=[],help='Original path or subtree, e.g. dataset/raw or workspace/scripts') ap.add_argument('--revision',default='main') ap.add_argument('--snapshot',type=Path,help='Use an already-downloaded Hub tree') a=ap.parse_args();a.out.mkdir(parents=True,exist_ok=True);root=a.out.resolve() if a.snapshot: def fetch(n):return a.snapshot/relative(n) else: from huggingface_hub import HfApi,hf_hub_download rev=HfApi().model_info(REPOSITORY,revision=a.revision).sha def fetch(n):return Path(hf_hub_download(REPOSITORY,n,revision=rev)) index=fetch('archive/file-index.jsonl.gz') links=json.loads(fetch('archive/links.json').read_text()) with gzip.open(index,'rt',encoding='utf8') as f:all_rows=[json.loads(s) for s in f] def at(name): p=root/relative(name) if root not in p.parent.resolve().parents and p.parent.resolve()!=root: raise ValueError('Path outside destination '+name) return p # Selecting a symbolic link also restores the data it names. prefixes={p.strip('/') for p in a.prefix} if prefixes: while True: extra={link['target'] for link in links['symlinks'] if select(link['path'],prefixes)} if extra<=prefixes:break prefixes.update(extra) rows=[r for r in all_rows if select(r['path'],prefixes)] if not rows:raise SystemExit('No matching original paths') byhub=defaultdict(list);bysha=defaultdict(list) for r in rows:bysha[r['sha256']].append(r) for same in bysha.values(): first=next((r for r in same if 'member' not in r),same[0]) byhub[first['hub']].append(first) written={} for source,needed in byhub.items(): fetched=fetch(source) if 'member' not in needed[0]: for r in needed: path=at(r['path']) with fetched.open('rb') as stream:materialize(path,stream,r) written[r['sha256']]=path else: wanted={r['member']:r for r in needed} with fetched.open('rb') as packed: proc=subprocess.Popen(['zstd','-qdc'],stdin=packed,stdout=subprocess.PIPE) try: with tarfile.open(mode='r|',fileobj=proc.stdout) as tar: for member in tar: r=wanted.pop(member.name,None) if r: if not member.isfile():raise ValueError(member.name) path=at(r['path']) with tar.extractfile(member) as stream:materialize(path,stream,r) written[r['sha256']]=path # Drain the trailing tar padding before validating the decompressor. while proc.stdout.read(2**20):pass finally:proc.stdout.close();rc=proc.wait() if rc or wanted:raise ValueError('Incomplete shard '+source) for sha,group in bysha.items(): origin=written[sha] for r in group: p=at(r['path']) if p==origin:continue with origin.open('rb') as stream:materialize(p,stream,r) for d in links['empty_directories']: if select(d,prefixes):at(d).mkdir(parents=True,exist_ok=True) for link in links['symlinks']: if not select(link['path'],prefixes):continue p=at(link['path']);target=at(link['target']) if p.is_symlink() and p.resolve()==target.resolve():continue if p.exists() or p.is_symlink():raise FileExistsError(p) p.parent.mkdir(parents=True,exist_ok=True);p.symlink_to(os.path.relpath(target,p.parent)) print('Verified',len(rows),'original file paths and',len(bysha),'distinct payloads in',root)if __name__=='__main__':main()123version https://git-lfs.github.com/spec/v1oid sha256:f48c878483391e8d5e6ad0779d7b2021d0839cfe84f1def10c9f972cec90fafesize 1999763141234567891011121314{ "refs/heads/codex/joint-cave-optimization-20261130": "33e21bdf965617cc3438fd40b4f6e75dca265689", "refs/heads/codex/rotation-validation": "3c7aec1adff19279de64c0b6321107d3d1632e1f", "refs/heads/codex/v7-full-coverage": "b6616261d55a9da327f55013a935bc6ae1ffe8a4", "refs/heads/codex/v8-scene-training": "ace1fd2c523ee134ac829ce01bfb9b77a30da98b", "refs/heads/main": "4e53a208382757c7b03b0c70c2ec22551a9de21e", "refs/tags/all-scenes-outpaint-20261201": "33e21bdf965617cc3438fd40b4f6e75dca265689", "refs/tags/dual-metrics-20261130": "e1dfb8b00276e04fb3525830d4915ca584bce55a", "refs/tags/field-fidelity-20261130": "15861f29cb22836c51a44447293a1bf109208c17", "refs/tags/joint-optimization-20261130": "ad67db2108bd87a9f0c90d2cd2d18c08b3bc0c7c", "refs/tags/models-archive-20261130": "9d19db69a6ba759bc4016d6d3d9c4f6ca1e29eb2", "refs/tags/texture-color-light-20261130": "183ec5766510d54d158ae84626c2eee457326f20", "refs/tags/v7-full-20261128": "d79c3cd74655435ec4797105743d76c4fcbdf764"}12345678910111213141516171819202122{ "refs": { "refs/heads/codex/joint-cave-optimization-20261130": "33e21bdf965617cc3438fd40b4f6e75dca265689", "refs/heads/codex/rotation-validation": "3c7aec1adff19279de64c0b6321107d3d1632e1f", "refs/heads/codex/v7-full-coverage": "b6616261d55a9da327f55013a935bc6ae1ffe8a4", "refs/heads/codex/v8-scene-training": "ace1fd2c523ee134ac829ce01bfb9b77a30da98b", "refs/heads/main": "4e53a208382757c7b03b0c70c2ec22551a9de21e", "refs/tags/all-scenes-outpaint-20261201": "33e21bdf965617cc3438fd40b4f6e75dca265689", "refs/tags/dual-metrics-20261130": "e1dfb8b00276e04fb3525830d4915ca584bce55a", "refs/tags/field-fidelity-20261130": "15861f29cb22836c51a44447293a1bf109208c17", "refs/tags/joint-optimization-20261130": "ad67db2108bd87a9f0c90d2cd2d18c08b3bc0c7c", "refs/tags/models-archive-20261130": "9d19db69a6ba759bc4016d6d3d9c4f6ca1e29eb2", "refs/tags/texture-color-light-20261130": "183ec5766510d54d158ae84626c2eee457326f20", "refs/tags/v7-full-20261128": "d79c3cd74655435ec4797105743d76c4fcbdf764" }, "commits": 72, "checked_historical_text_and_small_blobs": 1162, "git_lfs_pointers": [], "bytes": 199976314, "sha256": "f48c878483391e8d5e6ad0779d7b2021d0839cfe84f1def10c9f972cec90fafe", "restored_in_empty_repository": true}123version https://git-lfs.github.com/spec/v1oid sha256:cde04d54abcbddc6a4bc6b72780fdc20d01d3e51fdbe86672d1e4261572c2baasize 1900123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384#!/usr/bin/env python3"""Run the lightweight HY-Pano-2-Qwen and WorldStereo-2 DMD baselines.
The WorldStereo invocation intentionally uses a single manually specifiedtrajectory so it can be evaluated without the optional WorldNav/Qwen3-VLservice. The generated scene is still in the same directory layout consumedby the official WorldStereo data loader."""
from __future__ import annotations
import argparseimport jsonimport mathimport osfrom pathlib import Path
import cv2import numpy as np
def erp_to_perspective(erp: np.ndarray, yaw: float, width: int, height: int, fov_deg: float = 90.0) -> np.ndarray: """Project an equirectangular panorama to a rectilinear view.""" focal = 0.5 * width / math.tan(math.radians(fov_deg) / 2.0) xx, yy = np.meshgrid(np.arange(width), np.arange(height)) x = (xx - (width - 1) / 2.0) / focal y = (yy - (height - 1) / 2.0) / focal z = np.ones_like(x) norm = np.sqrt(x * x + y * y + z * z) x, y, z = x / norm, y / norm, z / norm cy, sy = math.cos(yaw), math.sin(yaw) xr = cy * x + sy * z zr = -sy * x + cy * z lon = np.arctan2(xr, zr) lat = np.arcsin(np.clip(y, -1.0, 1.0)) map_x = ((lon / (2.0 * math.pi)) + 0.5) * erp.shape[1] map_y = (0.5 - lat / math.pi) * erp.shape[0] return cv2.remap(erp, map_x.astype(np.float32), map_y.astype(np.float32), cv2.INTER_LINEAR, borderMode=cv2.BORDER_WRAP)
def write_scene(panorama: Path, scene: Path, frames: int = 21) -> None: import imageio.v2 as imageio
erp = cv2.cvtColor(cv2.imread(str(panorama)), cv2.COLOR_BGR2RGB) width, height = 832, 480 traj_dir = scene / "render_results" / "view0" / "traj0" memory_dir = traj_dir / "memory_inputs" memory_dir.mkdir(parents=True, exist_ok=True) scene.mkdir(parents=True, exist_ok=True) (scene / "render_results" / "view0").mkdir(parents=True, exist_ok=True) with (scene / "meta_info.json").open("w") as f: json.dump({"scene_type": "indoor"}, f)
views = [erp_to_perspective(erp, math.radians(-18.0 + 36.0 * i / (frames - 1)), width, height) for i in range(frames)] imageio.imwrite(scene / "render_results" / "view0" / "start_frame.png", views[0]) imageio.mimsave(traj_dir / "render.mp4", views, fps=16, codec="libx264", quality=8) masks = [np.full((height, width, 3), 255, dtype=np.uint8) for _ in views] imageio.mimsave(traj_dir / "render_mask.mp4", masks, fps=16, codec="libx264", quality=8) imageio.mimsave(memory_dir / "worldstereo-memory-dmd.mp4", views, fps=16, codec="libx264", quality=8)
focal = 0.5 * width / math.tan(math.radians(90.0) / 2.0) intrinsic = [] extrinsic = [] for i in range(frames): intrinsic.append([[focal, 0, width / 2], [0, focal, height / 2], [0, 0, 1]]) mat = np.eye(4, dtype=np.float32) mat[0, 3] = 0.02 * i extrinsic.append(mat.tolist()) with (traj_dir / "camera.json").open("w") as f: json.dump({"intrinsic": intrinsic, "extrinsic": extrinsic}, f) with (traj_dir / "traj_caption.json").open("w") as f: json.dump({"prompt": "A realistic underground construction tunnel with rough shotcrete rock walls, an arched cavern ceiling, an excavator, rubble and low industrial lighting, documentary camera movement."}, f)
def main() -> None: parser = argparse.ArgumentParser() parser.add_argument("--panorama", required=True, type=Path) parser.add_argument("--scene", required=True, type=Path) args = parser.parse_args() write_scene(args.panorama, args.scene)
if __name__ == "__main__": main()123version https://git-lfs.github.com/spec/v1oid sha256:7f47ef6353b38a2366446594e74c9335027a8ee79ccac2c848f1afea6f39850csize 4579123version https://git-lfs.github.com/spec/v1oid sha256:c9e1ae092a1ae02f69be26420dc77394b54582b5daff34c1278e55f29b0770a5size 394.gitattributes+4
archive/file-index.jsonl.gzAdded+3
archive/inventory.jsonAdded+33
archive/restore-check.jsonAdded+26
archive/restore.pyAdded+118
code/history/CaveWorld3D.bundleAdded+3
code/history/refs.jsonAdded+14
code/history/verification.jsonAdded+22
code/upstream-patches/HY-World-2.0.patchAdded+3
code/upstream-patches/HY-World-2.0/run_hypano_worldstereo_baselines.pyAdded+84
code/upstream-patches/HunyuanWorld-Voyager.patchAdded+3
code/upstream-patches/revisions.jsonAdded+3