MoGe-2 ViT-L Normal

MOGE_2_VITL_NORMAL

Estimates metric depth, surface normals and the camera's field of view from a single photo of any scene, indoors or out.

Utilitiesdepth-estimationmetric-depthsurface-normals3dmitFine-tunable
MoGe-2 ViT-L Normal: Utilities model on Kainguru

About MoGe-2 ViT-L Normal

Capabilities

  • Metric depth — the distance of every pixel in metres, as a 16-bit PNG in millimetres
  • Surface normals — the direction each surface faces, as an RGB normal map
  • Field of view — the camera's horizontal field of view, estimated from the photo, in the result
  • Any scene — indoor and outdoor photos; the sky and other pixels without a surface are marked
  • Fine-tuning — adapt its depth to your camera and scenes with your own photo and depth-map pairs

Good to know

  • Pixels without a surface, such as the sky, are 0 in the 16-bit depth map and black in the colour pictures; depth beyond 65.5 m reads as 65.5 m.
  • Normal maps use the usual colours: red for right, green for up and blue for towards the camera.
  • The result also gives fov_x, the camera's estimated horizontal field of view in degrees.
  • Fine-tuning learns metric depth from your depth maps (normals and field of view are not trained), at the learning rates MoGe advises: 1e-6 for the image encoder by default (at most 1e-5), the heads 10 times faster.
  • Training pairs are centre-cropped to 504 x 504 pixels; a pair with fewer than 16 pixels of usable depth there is left out.
  • Training photos are as for a run: PNG, JPEG or WebP, at most 50 MB and 40 megapixels, at least 32 pixels a side and at most 4:1.
  • Training depth maps are 16-bit grayscale PNGs of their photo's size as displayed, at most 50 MB, holding the distance from the camera (larger = farther, 0 = unknown), never a model's nearness output.
  • In the training ZIP, manifest.jsonl is at most 10 MB and its paths are relative to it.
  • Training stops after 5,000 steps or 9 hours, whichever comes first, and keeps what it learned.

Attribution

MoGe-2 by Ruicheng Wang and colleagues at Microsoft Research, released under the MIT License, Copyright (c) Microsoft Corporation. Its DINOv2 image encoder is Copyright (c) Meta Platforms, Inc. and affiliates, released under the Apache License 2.0.

MoGe-2 ViT-L Normal inputs and output

NameTypeRequiredDefaultDetails
imagefileYes—The photo: PNG, JPEG or WebP, at most 50 MB and 40 megapixels, at least 32 pixels a side and at most 4:1. The depth map has the photo's size, scaled down to 2048 pixels on the longer side.
1–2048 characters · image/png, jpeg, webp
outputtextNopng16png16: a 16-bit grayscale PNG of the depth in millimetres, 0 where there is no surface (sky). colormap: a colour picture of it, near is bright. normal: the surface directions as an RGB normal map.
Allowed: png16, colormap, normal

Output. Returns PNG image: A PNG, as chosen in output: the depth map (16-bit grayscale or a colour picture) or the normal map; the result also gives the camera's horizontal field of view (fov_x).

Run MoGe-2 ViT-L Normal with the API

Send your API key in the X-API-Key header. The run is asynchronous: submit it, then poll it until it finishes. Create an API key.

cURL
curl -X POST "https://api.kainguru.com/api/v1/executions?mlFlowId=MOGE_2_VITL_NORMAL" \
  -H "X-API-Key: kg_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "image": "https://example.com/input.png",
    "output": "png16"
  },
  "outputFormat": "json"
}'

# Poll until the execution reaches a terminal state
curl "https://api.kainguru.com/api/v1/executions/{executionId}" \
  -H "X-API-Key: kg_your_api_key"
Python
from kainguru import KainguruClient

with KainguruClient(api_key="kg_your_api_key", base_url="https://api.kainguru.com/api") as client:
    submitted = client.executions.execute(
        "MOGE_2_VITL_NORMAL",
        {
          "image": "https://example.com/input.png",
          "output": "png16"
        },
        output_format="json",
    )
    result = client.executions.await_completion(submitted.id)
    print(result.execution.output)

Fine-tune MoGe-2 ViT-L Normal

You can fine-tune MoGe-2 ViT-L Normal on your own data and run the tuned model through the same API. Dataset: One ZIP (at most 4 GB, 5000 entries, no password) with 4 to 1000 photos, a depth map for each and a manifest.jsonl with one {"file", "depth"} line per pair. Depth maps are 16-bit grayscale PNGs of distance. More rules: Good to know, in the README.

The steps are in the docs.

MoGe-2 ViT-L Normal pricing

Price per image: 0.0874 credits ($0.000874). The price is shown again before every run; all prices are on the pricing page.

Licence and source

ZoeDepth NYU: Utilities model on Kainguru
Utilities

ZoeDepth NYU

Measures how far away every point of an indoor photo is, in metres (up to 10 m).

Fine-tunable
BiRefNet General: Utilities model on Kainguru
Utilities

BiRefNet General

Removes the background from a photo and returns the subject on a transparent background, or as a black-and-white mask.

Fine-tunable
Cloth Segmentation U2-Net: Utilities model on Kainguru
Utilities

Cloth Segmentation U2-Net

Finds the clothes a person wears in a photo and returns a mask for the upper body, the lower body and full-body…

Fine-tunable
Depth Anything v2 Small: Utilities model on Kainguru
Utilities

Depth Anything v2 Small

Turns any photo into a depth map that shows which parts are near and which are far.

Fine-tunable
EoMT Large COCO Panoptic: Utilities model on Kainguru
Utilities

EoMT Large COCO Panoptic

Splits a picture into its objects and regions, such as people, cars, sky and road, with a label and a mask for each one.

Fine-tunable
InSPyReNet: Utilities model on Kainguru
Utilities

InSPyReNet

Removes the background from a photo with fine detail at hair and edges, and returns the subject on a transparent…

Fine-tunable