Necessity Robotics Contact

nrs-large · depth model · zero-shot ML

Zero-shot depth from two cameras.

Two cameras, like two eyes. This ML model (machine learning, a kind of AI) works out how far away each point is. It learned only from computer-made images. We tested it on real photos from cameras it never saw. We trained it from scratch. The network design, DLNR, is from another team.

nrs-large version 0.1.0 Free download Paper: PDF. Author: Sumedh Bouddh

  • 57 millionparameters
  • 155,769computer-made photo pairs it learned from: synthetic training data
  • 200,000training steps, 92 hours on one graphics card
  • From scratchrandom initialisation, no other team's trained model inside

See the difference

Same photo. Two ways to see depth.

Left: 32-path SGM, the classic method: a fixed rule. Right: our depth model: learned from examples. DragSlide the line.

Depth from the classic method (SGM32): blotchy, with grey stripes where it has no answer
Depth from our ML model (nrs-large): sharp edges on tree trunks and posts
Classic: 32-path SGM ML: nrs-large

Bright = near. Dark = far. Grey stripes = no answer. The photo is the grey image that both methods see.

Classic method: an answer for 96 % of the pixels. ML model: 100 %. Where both answer, they agree within one pixel on 91 % of them.

What to look for

Trunks, poles, fences, leaves. The ML model draws sharper edges. The classic method smears them and leaves holes.

Where the ML model guesses

It answers every pixel, also sky, glare and blank walls, where nobody can measure. It cannot say "I do not know". The classic method says "no answer" there.

Same place, built twice.

Same photos, two depths, two 3-D places.

Depth gives a 3-D place its starting shape. We built each place twice from the same photos and camera path. Only the depth changed. Move one view: the other follows.

The 3-D place built with classic depth (SGM32)
Classic depth 32-path SGM
The 3-D place built with depth from our ML model (nrs-large)
ML depth nrs-large

Drag in either view to look around. Use the arrow keys to walk.

How close each place looks to photos it never saw

We kept some camera photos out of the build, then compared them with the 3-D place from the same spot. Higher is closer (PSNR). We give two measures: the map alone, and the map with a sky backdrop behind it. On the field places most of each photo is sky, which a map does not hold, so their "map alone" numbers are low for both. The new depth is better on 3 of 8 places for the map alone and on 6 of 8 with the sky. The changes are small, and some places got a little worse.

How close each 3-D place looks to camera photos it never saw (PSNR in dB, higher is better), for the map alone and with the sky backdrop.
PlaceMap alone (dB)With the sky backdrop (dB)
OldSGM32MLnrs-largeChangeOldSGM32MLnrs-largeChange
A park path under trees203 test photos19.2619.64+0.38 (better)19.6719.93+0.26 (better)
A street in India188 test photos17.0817.50+0.42 (better)19.9020.08+0.18 (better)
A lane under trees115 test photos18.1417.99-0.15 (worse)20.4120.11-0.30 (worse)
A long straight road112 test photos18.0417.05-0.99 (worse)19.5219.62+0.10 (better)
A shaded park walk264 test photos17.6417.76+0.12 (better)17.9117.94+0.03 (better)
A soybean field in Argentina184 test photos11.7910.45-1.34 (worse)21.2820.78-0.50 (worse)
Soybean rows beside a dry field66 test photos7.176.65-0.52 (worse)27.3827.44+0.06 (better)
Long green soybean rows60 test photos7.447.17-0.27 (worse)27.3527.39+0.04 (better)

Seen from the same spot

A camera photo that neither map was built from, and both maps from the same spot. Four photos per place. All are shown, also where the classic depth looks closer.

Camera photo, the 3-D place with the classic depth, and the 3-D place with the ML depth, from the same spot

How we trained it

From random numbers to depth, in four steps.

  1. 1 · Data

    Computer-made worlds

    Rooms, flying objects and nature, rendered by a computer. The true distance of every pixel is known, so the network can be graded exactly. 155,769 stereo pairs from the public WMGStereo-150k set.

  2. 2 · Training

    From scratch, on one GPU

    Supervised deep learning: 200,000 steps of gradient descent, 92 hours on one NVIDIA RTX 5090. The network started from random numbers.

  3. 3 · Test

    Real photos it never saw

    A zero-shot test on six public benchmark sets of real photos. For four of them we wrote the pass marks down before training began (pre-registration). It passed 4 of 4.

  4. 4 · Use

    Into our 3-D places

    Our 3-D places take their depth from this model. It is also the teacher of our small model, nrs-edge.

Scores on real photos (lower is better)

Each number is the share of pixels whose answer is off by more than 1, 2 or 3 pixels (bad-1, bad-2, bad-3). Another team trained this same network design on this data set and published its scores. We followed their recipe, with small changes that we list. Our copy of the nature data had 7,627 fewer pairs. Our numbers are within 5 % (or 0.1) of theirs on 4 of 6 sets. On ETH3D ours is better. On Middlebury 2021 ours is worse.

Error on public test sets the model never trained on. Lower is better.
Test setMeasurenrs-largeour weightsSame design, publishedother team's training, same dataRAFT-Stereopublic weights, scored in TF32Our run against the published rowsame within 5 % or 0.1
Middlebury (half size)indoor scenesbad-23.91 %3.76 %8.67 %Same
Middlebury 2021indoor scenesbad-28.44 %6.72 %10.26 %Worse
ETH3Dindoor and outdoorbad-12.04 %2.50 %2.61 %Better
KITTI 2012city streetsbad-33.38 %3.30 %4.76 %Same
KITTI 2015city streetsbad-34.59 %4.54 %5.48 %Same
Booster (quarter size)glass, mirrors and screensbad-29.22 %9.09 %17.75 %Same

What it cannot do (yet)

The honest list.

  • It is slow. Inference: 0.28 s per photo pair (640 × 480) on one RTX 5090. In our map builds: 0.24 to 0.72 s per pair, 80 to 280 times slower than the classic method (about 3 ms). So we use it only after the recording, to give depth to our map builder. Our live software that tells a robot where it is (xclean) uses no neural network.
  • It learned only from computer-made pictures. Real camera noise, glare and blur are new to it: the sim-to-real gap.
  • It always answers. Also where it can only guess: sky, glare, blank walls. It cannot say "I do not know". The classic method says "no answer" there.
  • The maps changed only a little. With the sky backdrop, the new maps are better on 6 of 8 places. The map alone is better on only 3 of 8. Two places got worse on both measures: the soybean field in Argentina and the lane under trees.
  • Glass and mirrors fool it. On photos of TV screens, 64 % of the pixels are off by more than 2 pixels.
  • The network design is not ours. It is DLNR, published by Zhao and others with open code (MIT licence). The trained weights are ours.
  • One test is worse than published. On Middlebury 2021 we score 8.44 % against their 6.72 %. We do not know why. Our copy of the nature data had 7,627 fewer pairs than theirs. That may be the cause. We have not tested it.
  • The last refinement step did not always run. The design runs it only when every pixel gets a positive answer. On the photos of the 8 outdoor places it ran on only some of them: it was skipped on 47 to 83 % of the photos of each place (the 83 % is a farm-robot field; on our own camera it was 47 to 75 %).

Our small model

nrs-edge: a small model for the robot itself.

nrs-edge 0.1.0 has 6 million parameters; nrs-large has 57 million. nrs-large was its teacher. It is less exact than nrs-large. It has its own page.

For engineers

nrs-large 0.1.0

Free to download under Apache-2.0, also for commercial use.

Task
Dense stereo matching: disparity of the left image for every pixel; depth = focal length × baseline ÷ disparity.
Architecture
DLNR (high-frequency stereo matching): channel-attention transformer feature extractor, 1-D correlation pyramid (4 levels, radius 4), multi-level LSTM-style recurrent update block, normalisation refinement. 32 iterations at inference.
Size
57.4 M parameters. FP32 inference, TF32 off.
Training
Random initialisation; WMGStereo-150k only (BSD-3-Clause tag on its dataset card); the authors' recipe (AdamW, OneCycle, batch 8, crop 384×736) with our listed changes: bf16 mixed precision with FP32 correlation and loss; micro-batch 2 with 4-step gradient accumulation; 200,000 steps, 92 GPU-hours (RTX 5090).
Evaluation
Zero-shot, WMG protocol, our harness (it reproduces the published RAFT-Stereo numbers). Release gate fixed before training (pre-registered): 4 of 4 passed.
Paper
nrs-large: retraining the DLNR stereo network from scratch on synthetic data, with open weights for commercial use (PDF, version 1.2, 25 November 2026). It gives the full recipe, every declared deviation, the test protocol, all results and the limits. Version 1.2 adds a section on nrs-edge; no result of version 1.1 changed.
In our maps
Our map builder, xclean-maps, with nrs-large depth: a version not released yet (the released xclean-maps 0.1.0 uses 32-path SGM only). The same poses, keyframes and recipe as the earlier maps; only the depth changed.