MoGe-3
MoGe-3 是微软(Microsoft)的单目几何模型。它从一张 RGB 图像预测以米为单位的度量深度、相机坐标系下的点图、相机内参、有效性掩码和表面法线。它是 MoGe-2 加上一个稀疏 3D UNet,后者在体素网格上细化预测的深度。LibreYOLO 提供官方的 ViT-L 和 ViT-g 检查点,用于推理、验证和法线导出。
- 任务
- depth, surface normals
- 尺寸
- l, g at 840 px
- 安装
pip install libreyolo- 支持层级
- 仅推理,自 v1.8.0 起。仅支持预测、验证和导出。训练相关的功能不适用。
- 许可
- 代码采用 MIT,权重采用 MIT。商用
安装
MoGe-3 不需要任何可选 extra。稀疏细化器是纯 PyTorch,相机参数恢复用的是 SciPy, 它在基础安装里。
pip install libreyolo预测
权重在首次使用时从 LibreYOLO 的 Hugging Face 镜像下载。
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreMoGe3l-depth.pt")depth = model(SAMPLE_IMAGE).depth_map print(depth.data.shape) # (H, W),单位为米,有效掩码之外为 infprint(depth.point_map.shape) # (H, W, 3),相机坐标系下的点,单位为米print(depth.intrinsics) # (3, 3),OpenCV 像素内参print(depth.valid_mask.shape) # (H, W) boolfrom libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreMoGe3l-normal.pt")normal = model(SAMPLE_IMAGE).normal_mapprint(normal.array.shape) # (H, W, 3) 单位向量,OpenCV 坐标系libreyolo predict model=LibreMoGe3l-depth.pt source=https://raw.githubusercontent.com/LibreYOLO/libreyolo/release/libreyolo/assets/guggenheim-bilbao.jpg save=True使用 -depth 检查点时,result.depth_map 存放以米为单位的度量深度
(encoding="depth"、metric=True)。点图、内参和有效性掩码作为
depth_map.point_map、depth_map.intrinsics 和 depth_map.valid_mask 附在它
上面;掩码之外的像素为 inf。点使用 OpenCV 坐标轴,内参把像素中心放在整数坐标上。
使用 -normal 检查点时,result.normal_map 存放 OpenCV 相机坐标系下的单位法线。
imgsz 设置 ViT 的 token 预算,即按图像宽高比排布的 (imgsz // 14) ** 2 个 token。
默认值 840 是上游的最高分辨率档(3600 个 token);490 接近它的最低档。输入保持原生
分辨率,每个输出都会插值回这个分辨率。推理以 FP32 运行,并且像上游默认做法一样总是
执行三步细化。每次前向传播处理一张图像;没有堆叠批处理的路径。
CPU、CUDA 和 MPS 都能运行,不需要编译扩展。细化器的内存随 imgsz 增长,而不是随
输入分辨率增长。
变体
| 权重文件 | 骨干 | 任务 |
|---|---|---|
LibreMoGe3l-depth.pt | DINOv2 ViT-L/14 | 深度、点图、内参、掩码 |
LibreMoGe3l-normal.pt | DINOv2 ViT-L/14 | 法线 |
LibreMoGe3g-depth.pt | DINOv2 ViT-g/14 | 深度、点图、内参、掩码 |
LibreMoGe3g-normal.pt | DINOv2 ViT-g/14 | 法线 |
同一尺寸的 -depth 和 -normal 文件存放的是相同的张量;后缀决定任务。在 RTX 3090
上以 FP32 与上游对比,单次前向的计算图逐位一致,细化后的深度一致到浮点舍入误差
(l 的 p99 相对差异为 4.7e-6,g 为 3.7e-5)。
MoGe-3 在 LibreYOLO 里不可训练:train() 会抛出异常。零样本 val() 运行共用的
深度和法线验证器。
导出
| 任务 | ONNX | TorchScript | ExecuTorch | TensorRT | OpenVINO | Paddle | MNN | RKNN | Axelera | ncnn | TFLite | CoreML | Core AI |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Depth | Depth to ONNX:不支持 | Depth to TorchScript:不支持 | Depth to ExecuTorch:不支持 | Depth to TensorRT:不支持 | Depth to OpenVINO:不支持 | Depth to Paddle:不支持 | Depth to MNN:不支持 | Depth to RKNN:不支持 | Depth to Axelera:不支持 | Depth to ncnn:不支持 | Depth to TFLite:不支持 | Depth to CoreML:不支持 | Depth to Core AI:不支持 |
| Surface normals | Surface normals to ONNX:支持 | Surface normals to TorchScript:支持 | Surface normals to ExecuTorch:不支持 | Surface normals to TensorRT:不支持 | Surface normals to OpenVINO:不支持 | Surface normals to Paddle:不支持 | Surface normals to MNN:不支持 | Surface normals to RKNN:不支持 | Surface normals to Axelera:不支持 | Surface normals to ncnn:不支持 | Surface normals to TFLite:不支持 | Surface normals to CoreML:不支持 | Surface normals to Core AI:不支持 |
只有法线计算图能导出,支持 ONNX 和 TorchScript,使用固定的正方形画布。深度导出被 阻止:细化器构建的体素集合依赖数据,而相机参数恢复是在 CPU 上求解的。
from libreyolo import LibreYOLO # 只有法线计算图能导出;深度导出被阻止model = LibreYOLO("LibreMoGe3l-normal.pt")model.export(format="onnx")model.export(format="torchscript")检查点
| 文件 | 输入(px) | 权重许可 |
|---|---|---|
| Depth | ||
| LibreMoGe3l-depth.pt | mit | |
| LibreMoGe3g-depth.pt | mit | |
| Surface normals | ||
| LibreMoGe3l-normal.pt | 840 | mit |
| LibreMoGe3g-normal.pt | 840 | mit |
上面的每个文件目前都在 LibreYOLO 组织中,并会在首次使用时下载。
许可证
请检查你所下载的具体权重在 Hugging Face 仓库中的许可。LibreYOLO 组织里的每个检查点都附有许可,同一家族内也不一定相同。该仓库是权威来源;以下摘要说明本页上次验证时适用的情况。
这里只说明涉及的许可证,不构成法律意见。如果答案对商用很重要,请自行阅读许可证并咨询法律顾问。
- 原始工作
- MoGe-3, Microsoft
- 上游许可
- MIT
- LibreYOLO 代码
- MIT
- 权重
- 采用 MIT 许可,重新发布在 huggingface.co/LibreYOLO
- 解读
- MIT is a permissive license, so the MoGe-3 code and weights can be used in commercial and closed-source products; the only obligation is to keep the copyright and license notice with copies. LibreYOLO ports the forward pass, sparse refinement and camera recovery from microsoft/MoGe at commit 74fbce054ebed49800de42d0ad0e83495065719a (MIT, Copyright Microsoft Corporation), re-expresses the FlexGEMM sparse kernels in plain PyTorch without vendoring them (FlexGEMM is MIT), and follows MIT utils3d helpers; the DINOv2 backbone keeps its separate Apache-2.0 attribution (libreyolo/models/moge3/NOTICE). The official checkpoints Ruicheng/moge-3-vitl (revision 184008f877d7ad1ad4c2cd2182a9bd1f63d0e5be) and Ruicheng/moge-3-vitg (revision 6ef26c5a4b4148dab5ccaacdb08b72dc66380475) declare MIT; LibreYOLO mirrors them unchanged, plus checkpoint metadata, as LibreYOLO/LibreMoGe3{l,g}-{depth,normal}, not gated.
MoGe-3 出自微软(microsoft/MoGe)。代码和
权重采用 MIT 许可,所以可以商用。DINOv2 骨干保留其 Apache-2.0 署名。LibreYOLO 把
官方的 Ruicheng/moge-3-vitl 和 Ruicheng/moge-3-vitg 检查点(checkpoint)原样
镜像为 LibreYOLO/LibreMoGe3{l,g}-{depth,normal},不需要申请访问。
引用
@misc{kong2026finedetailmonoculargeometryestimation,
title={Fine-Detail Monocular Geometry Estimation with Self-Guided Sparse Volumetric Refinement},
author={Lingyu Kong and Ruicheng Li and Ruicheng Wang and Sicheng Xu and Chengtang Yao and Jianfeng Xiang and Jiaolong Yang},
year={2026},
eprint={2607.17967},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2607.17967},
}复制自作者在 github.com/microsoft/MoGe#-citation 上提供的引用块。