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.
Upstream
MoGe-2 by Microsoft, MIT. Paper, source
Licenses
Code MIT, weights MIT. Commercial use

Install

MoGe-2 needs no optional extra. Everything it imports is in the base install.

bash
pip install libreyolo

Predict

Weights download automatically on first use. Sizes s and l use LibreYOLO mirrors; b continues to use the upstream checkpoint.

Python
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 vectors
CLI
libreyolo predict model=LibreMoGe2s-normal.pt source=https://raw.githubusercontent.com/LibreYOLO/libreyolo/release/libreyolo/assets/parkour.jpg save=True

MoGe-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.

Python
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 pixels
CLI
libreyolo val model=LibreMoGe2s-normal.pt data=my-dataset.yaml imgsz=518

Export

TaskONNXTorchScriptExecuTorchTensorRTOpenVINOPaddleMNNRKNNncnnTFLiteCoreMLCore AI
Surface normalsSurface normals to ONNX: supportedSurface normals to TorchScript: supportedSurface normals to ExecuTorch: supportedSurface normals to TensorRT: supportedSurface normals to OpenVINO: supportedSurface normals to Paddle: not supportedSurface normals to MNN: not supportedSurface normals to RKNN: not supportedSurface normals to ncnn: supportedSurface normals to TFLite: not supportedSurface normals to CoreML: not supportedSurface 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.

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreMoGe2s-normal.pt")model.export(format="onnx", imgsz=518)model.export(format="tensorrt", imgsz=518, half=True)
CLI
libreyolo export model=LibreMoGe2s-normal.pt format=onnx imgsz=518libreyolo export model=LibreMoGe2s-normal.pt format=tensorrt imgsz=518 half=True
Use the exported file
from 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
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.

Verified against LibreYOLO v1.6.0. Support tables, checkpoints and benchmark numbers on this page are generated from the released library and the published weights, not written by hand.

MoGe-2 architecture

Select a variant or family overview, then select a block for details. Open the full diagram to zoom or download SVG and PNG.