depth2normal

A depth map goes in, a normal map comes out.

The graph doing the work is 1.7 KB of ONNX and it runs in this tab, so your image never leaves the browser. No depth map? Drop a photograph and it will estimate one first.

Drop a depth map here

or , or

A photograph works too: its depth can be estimated in the tab.

Depth
Normal

What it does

Two gradients, one vector per pixel, normalised to unit length. The depth is rescaled to a fixed range first, so an 8-bit and a 16-bit copy of one map give the same normals.

Rings in the output

Those are the source depth map's 8-bit steps, amplified by the derivative. Raise sigma until they go, or feed a 16-bit depth map, where the steps are 256 times smaller.

Same thing offline

pip install depth2normal gives you the CLI, the ONNX export and camera intrinsics for metric depth. The models on this page come from depth2normal export.