MoGe-2
MoGe-2 is a single-forward monocular geometry model that predicts a dense surface-normal field from one RGB image. LibreYOLO supports it for normal estimation only, through the official ViT-S, ViT-B and ViT-L checkpoints.
- Tasks
- normal
- Sizes
- s, b, l at 518 px
- Install
pip install libreyolo- Support tier
- Inference only, since v. Predict, validate and export only. Training features do not apply.
- Licenses
- Code MIT, weights MIT. Commercial use
Install
MoGe-2 needs no optional extra. Everything it imports is in the base install.
pip install libreyoloPredict
Weights download automatically on first use: LibreYOLO fetches the matching size directly from the official checkpoints and caches it locally.
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreMoGe2s-normal.pt")result = model(SAMPLE_IMAGE, save=True) normal = result.normal_mapprint(normal.array.shape) # (H, W, 3) float32 unit vectorslibreyolo predict model=LibreMoGe2s-normal.pt source=https://raw.githubusercontent.com/LibreYOLO/libreyolo/release/libreyolo/assets/parkour.jpg save=TrueMoGe-2 returns a dense field rather than a set of detections, so
result.boxes is empty and conf, iou and max_det have no effect.
result.normal_map holds the result: an (H, W, 3) array of unit vectors
in the OpenCV camera frame, where +x is right, +y is down, +z is into the
scene, and a surface facing the camera reads (0, 0, -1). Predicting a list of
images runs one forward pass per image; this family has no stacked-batch fast
path. See prediction for sources, streaming and result
handling.
Variants
Three encoder sizes ship as separate checkpoints: ViT-S, ViT-B and ViT-L, all at the same input resolution. LibreYOLO's benchmark harness has not measured this family, so there are no published accuracy numbers to compare them by; pick a size against your own compute budget.
Validate
val() measures angular error against a paired normal-map dataset: images
beside same-stem 16-bit normal PNGs, with an optional validity mask so padded
and invalid pixels never count. It returns the mean and median angular error
in degrees, plus the percentage of pixels within 11.25, 22.5 and 30 degrees.
from libreyolo import LibreYOLO model = LibreYOLO("LibreMoGe2s-normal.pt")metrics = model.val(data="my-dataset.yaml", imgsz=518) print(metrics["metrics/mean_angular_error"]) # degreesprint(metrics["metrics/median_angular_error"])print(metrics["metrics/within_11_25"]) # percent of pixelslibreyolo val model=LibreMoGe2s-normal.pt data=my-dataset.yaml imgsz=518Export
| Task | ONNX | TorchScript | ExecuTorch | TensorRT | OpenVINO | Paddle | MNN | RKNN | ncnn | TFLite | CoreML | Core AI |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| normal | normal to ONNX: supported. | normal to TorchScript: supported. | normal to ExecuTorch: supported. | normal to TensorRT: supported. | normal to OpenVINO: supported. | normal to Paddle: not supported | normal to MNN: not supported | normal to RKNN: not supported | normal to ncnn: supported. | normal to TFLite: not supported | normal to CoreML: not supported | normal to Core AI: not supported |
Normal export uses a fixed-resolution, batch-1 runtime contract: dynamic and
a batch other than 1 are rejected, and imgsz must be divisible by the ViT
encoder's patch size, which LibreYOLO checks before the run starts. An
exported artifact loads back through LibreYOLO() on its file suffix, so a
.onnx file behaves like a checkpoint and returns the same Results.
from libreyolo import LibreYOLO model = LibreYOLO("LibreMoGe2s-normal.pt")model.export(format="onnx", imgsz=518)model.export(format="tensorrt", imgsz=518, half=True)libreyolo export model=LibreMoGe2s-normal.pt format=onnx imgsz=518libreyolo export model=LibreMoGe2s-normal.pt format=tensorrt imgsz=518 half=Truefrom libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreMoGe2s-normal.onnx")result = model(SAMPLE_IMAGE) print(result.normal_map.array.shape)Licensing
Check the license on the Hugging Face repository of the specific weights you download. Every checkpoint in the LibreYOLO org carries one, and they are not always the same across a family. That repository is the authoritative source; the summary below describes what applied when this page was last verified.
This is a description of the licenses involved, not legal advice. If the answer matters commercially, read the licenses yourself and take your own counsel.
- Original work
- MoGe-2, Microsoft
- Upstream license
- MIT
- Upstream source
- github.com/microsoft/MoGe
- LibreYOLO code
- MIT
- Weights
- MIT, distributed by their authors. LibreYOLO does not host or mirror them.
- Interpretation
- MIT is a permissive license: the code and the official ViT-S, ViT-B and ViT-L checkpoints can be used in commercial and closed-source products. It asks that you keep the license text and copyright notice with any copy you redistribute, and it places no obligation on your own application code. LibreYOLO downloads these checkpoints directly from the official Hugging Face repositories at a pinned revision rather than copying them into its own organization, and verifies each file against a recorded SHA-256 checksum before use. The DINOv2 encoder MoGe-2 builds on is separately licensed Apache-2.0 by Meta AI; LibreYOLO reuses the DINOv2 implementation already bundled for its Depth Anything V2 family rather than copying it again here.
LibreYOLO does not copy these checkpoints into its own organization.
LibreYOLO("LibreMoGe2s-normal.pt") downloads the matching size directly from
the official Hugging Face repositories at a pinned revision, and verifies the
file against a recorded SHA-256 checksum before use.
Citation
@inproceedings{wang2025moge,
title={Moge: Unlocking accurate monocular geometry estimation for open-domain images with optimal training supervision},
author={Wang, Ruicheng and Xu, Sicheng and Dai, Cassie and Xiang, Jianfeng and Deng, Yu and Tong, Xin and Yang, Jiaolong},
booktitle={Proceedings of the Computer Vision and Pattern Recognition Conference},
pages={5261--5271},
year={2025}
}
@misc{wang2025moge2,
title={MoGe-2: Accurate Monocular Geometry with Metric Scale and Sharp Details},
author={Ruicheng Wang and Sicheng Xu and Yue Dong and Yu Deng and Jianfeng Xiang and Zelong Lv and Guangzhong Sun and Xin Tong and Jiaolong Yang},
year={2025},
eprint={2507.02546},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2507.02546},
}Copied from the authors' citation block at github.com/microsoft/MoGe#-citation.