Daily Tech Briefing
AI 科技速览

每天 5 分钟内学习 AI。获取最新的人工智能新闻,理解其重要性,并学习如何将其应用于您的工作。

AI 快讯
MarkTechPost · 2026/7/31 20:27:13

LingBot-Map Tutorial: GPU-Aware Inference and Point Cloud Export

AI 中文解读
LingBot-Map这个新工具把3D重建变得像“傻瓜相机”一样简单!它的核心亮点是:AI会自动检测你的显卡性能,自动调整所有复杂参数,你只需要输入一段视频或图片,它就能自动生成可用的3D模型文件。 通俗点说,以前想要把实物或场景变成3D模型,得懂各种专业设置,调参调到头大。现在这个工具就像一个智能管家,它会先看看你的电脑显卡有多强,然后自动决定怎么处理数据,全程不用你操心。从导入视频到导出模型,全自动化操作,生成的文件还能直接用在游戏、VR里。 对普通人来说,这意味着以后拍个视频就能把自己的房间、喜欢的建筑甚至小物件变成3D模型,发到网上分享或者用于3D打印。设计师和开发者也能省下大量调试时间,快速制作虚拟场景。这项技术大大降低了3D内容创作的门槛,让人人都能成为3D创作者。虽然目前还是面向技术用户,但离大众应用已经不远了!
In this tutorial, we implement an end-to-end streaming 3D reconstruction pipeline with LingBot-Map. We begin by configuring the input source, reconstruction settings, checkpoint selection, and output controls, then probe the available GPU and automatically tune frame limits, camera iterations, scale frames, and KV-cache parameters according to the detected VRAM. We install the repository and its dependencies, download the pretrained checkpoint, preprocess image or video frames, and construct the GCTStream model with streaming attention and long-range trajectory memory. We then perform mixed-precision inference, decode the predicted camera poses and intrinsic parameters, convert depth maps into world-coordinate point clouds, validate the recovered geometry, visualize the reconstructed scene and camera trajectory, and export the results as PLY, NPZ, or GLB artifacts. Copy CodeCopiedUse a different BrowserCFG = { "scene": "courthouse", "image_folder": None, "video_path": None, "fps": 10, "max_frames": None, "stride": None, "checkpoint": "lingbot-map.pt", "image_size": 518, "patch_size": 14, "use_sdpa": True, "mode": "streaming", "num_scale_frames": None, "keyframe_interval": None, "kv_cache_sliding_window": 64, "camera_num_iterations": None, "offload_to_cpu": True, "window_size": 128, "overlap_keyframes": 8, "conf_percentile": 55.0, "pixel_stride": 2, "max_plot_points": 60000, "export_ply": True, "export_glb": False, "launch_viser": False, "run_ablation": False, "seed": 0, } WORK = "/content" REPO = f"{WORK}/lingbot-map" OUT = f"{WORK}/lingbot_out" import os, sys, subprocess, glob, json, time, math, shutil, textwrap os.environ.setdefault("PYTORCH_CUDA_ALLOC_CONF", "expandable_segments:True") os.makedirs(OUT, exist_ok=True) def sh(cmd, check=True): p = subprocess.run(cmd, shell=True, capture_output=True, text=True) if p.returncode != 0 and check: print(p.stdout[-3000:]); print(p.stderr[-3000:]) raise RuntimeError(f"command failed: {cmd}") return p def probe_gpu(): try: q = sh("nvidia-smi --query-gpu=name,memory.total --format=csv,noheader", check=False) if q.returncode != 0 or not q.stdout.strip(): return None, 0.0 name, mem = [x.strip() for x in q.stdout.strip().split("\n")[0].split(",")] return name, float(mem.split()[0]) / 1024.0 except Exception: return None, 0.0 GPU_NAME, VRAM_GB = probe_gpu() print("=" * 78) print(f"GPU : {GPU_NAME or 'NONE — enable Runtime > Change runtime type > GPU'}") print(f"VRAM : {VRAM_GB:.1f} GB") try: import psutil print(f"System RAM : {psutil.virtual_memory().total/2**30:.1f} GB") except Exception: pass print(f"Free disk : {shutil.disk_usage(WORK).free/2**30:.1f} GB (checkpoint is 4.6 GB)") print("=" * 78) if GPU_NAME is None: raise SystemExit("This model needs a CUDA GPU. Switch the Colab runtime to GPU.") if VRAM_GB < 18: AUTO = dict(max_frames=48, num_scale_frames=4, camera_num_iterations=2, kvsw=48) tier = "small (<18 GB)" elif VRAM_GB < 30: AUTO = dict(max_frames=96, num_scale_frames=8, camera_num_iterations=4, kvsw=64) tier = "medium (18-30 GB)" else: AUTO = dict(max_frames=240, num_scale_frames=8, camera_num_iterations=4, kvsw=64) tier = "large (30+ GB)" if CFG["max_frames"] is None: CFG["max_frames"] = AUTO["max_frames"] if CFG["num_scale_frames"] is None: CFG["num_scale_frames"] = AUTO["num_scale_frames"] if CFG["camera_num_iterations"] is None: CFG["camera_num_iterations"] = AUTO["camera_num_iterations"] if VRAM_GB < 18: CFG["kv_cache_sliding_window"] = AUTO["kvsw"] print(f"Auto-tuned for {tier}: max_frames={CFG['max_frames']}, " f"scale_frames={CFG['num_scale_frames']}, " f"cam_iters={CFG['camera_num_iterations']}, " f"kv_window={CFG['kv_cache_sliding_win
分享
阅读原文