This is the documentation for LibreYOLO 1.6.0. See the current version.
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
- surface normals
- Sizes
- s, b, l at 518 px
- Install
pip install libreyolo- Support tier
- Inference only, since v1.5.0. 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. Sizes s and l use LibreYOLO mirrors; b continues to use the upstream checkpoint.
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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Surface normals | Surface normals to ONNX: supported | Surface normals to TorchScript: supported | Surface normals to ExecuTorch: supported | Surface normals to TensorRT: supported | Surface normals to OpenVINO: supported | Surface normals to Paddle: not supported | Surface normals to MNN: not supported | Surface normals to RKNN: not supported | Surface normals to ncnn: supported | Surface normals to TFLite: not supported | Surface normals to CoreML: not supported | Surface normals 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, republished at huggingface.co/LibreYOLO
- Interpretation
- The publisher declares MIT for the model and checkpoints. LibreYOLO mirrors s and l; b remains an upstream download. The DINOv2 encoder retains its separate Apache-2.0 attribution.
The s and l checkpoints are mirrored by LibreYOLO; b stays upstream. Downloaded artifacts retain their publisher's license.
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.