运行时依赖
无特殊依赖
安装命令
点击复制官方npx clawhub@latest install image-3d-scene-reconstruction
镜像加速npx clawhub@latest install image-3d-scene-reconstruction --registry https://cn.longxiaskill.com 镜像可用
技能文档
图像3D场景重建 | Image 3D Scene Reconstruction 从卫星图、航拍图或普通照片重建三维场景结构。基于 DA3Metric-Large(Depth Anything 3)深度估计模型,单张图片即可输出深度图、点云和 3D 模型。 能力 | Capabilities
- 单图深度估计:输入一张图片,输出米制深度图(米为单位)
- 点云生成:从深度图反投影生成彩色 3D 点云
- 3DGS 输出:模型内置 3D Gaussian Splatting 能力
- 相机位姿估计:自动估计相机内外参
- 多图融合:支持多张图片输入做场景融合
cd ~/.openclaw/workspace/projects/image-3d-scene-reconstruction
python3 scripts/reconstruct.py --input photo.jpg --output output/
Python API
from depth_anything_3.api import DepthAnything3
import cv2
model = DepthAnything3.from_pretrained('depth-anything/DA3Metric-Large')
model = model.cuda().eval()
img = cv2.imread('photo.jpg')
pred = model.inference([img])
depth = pred.depth[0] # [H, W] 米制深度
extrinsics = pred.extrinsics # 相机外参
intrinsics = pred.intrinsics # 相机内参
CLI
# 单张图片 → 3D 输出
python3 -m depth_anything_3.cli image photo.jpg --export-dir output/ --export-format glb
# 多张图片 → 融合场景
python3 -m depth_anything_3.cli images ./photos/ --export-dir output/
依赖 | Dependencies
- depth-anything-3:深度估计 + 3D 重建引擎
- opencv-python:图像处理
- torch + torchvision:PyTorch 深度学习框架
- open3d:点云处理(可选)
- trimesh:Mesh 处理(可选)
- GPU:NVIDIA GPU,6GB+ VRAM(GTX 1060 及以上)
- CUDA:12.1+(PyTorch 2.5+)
- CPU 模式:可用但极慢,仅推荐测试