nrs-edge
nrs-edge is a small stereo depth network by Necessity Robotics (6.04 M parameters). It takes a rectified stereo pair and gives the disparity of the left image. With the focal length and the baseline of your rig it also gives metric depth.
- Weights licence: Apache-2.0. The weights are ours (
nrs-edge 0.1.0). Network design: LiteAnyStereo v2, size S, by Jing et al. (MIT code, unmodified). - Code, model card, Linux and Jetson guide: https://github.com/necessityrobotics/nrs-edge
- Weights download: https://huggingface.co/Pyassahu/nrs-edge
Install and check
pip install nrs-edge
nrs-edge check
If pip does not find nrs-edge, the package is not on PyPI yet. Then use: pip install "git+https://github.com/necessityrobotics/nrs-edge" (this needs git).
nrs-edge check downloads the weights (about 24 MB, no login, checked by SHA-256), runs three bundled pairs and compares the result with our reference. It must print nrs-edge check: PASS.
Use
Command line:
nrs-edge run --left left.png --right right.png --out_dir out --fx 471.049 --baseline 0.07514
--fx is the rectified focal length in pixels and --baseline the baseline in metres. Without them you get disparity only.
Python:
import nrs_edge
model = nrs_edge.load() # ONNX Runtime on the CPU
disparity = model("left.png", "right.png") # float32, H x W, pixels
depth = nrs_edge.depth_from_disparity(disparity, fx_px=471.049, baseline_m=0.07514) # metres; NaN = no value
A picture can be a file path or a numpy array. An array must be uint8 in RGB order (not the BGR order of cv2.imread), or a grey picture (H x W).
The default path uses ONNX Runtime and needs no PyTorch. Its graphs take pictures of 640 x 400 and 640 x 480. A smaller picture is padded. A larger picture is resized to exactly the graph size: the aspect ratio is not kept, and detail is lost.
For any picture size, use the PyTorch path. First install PyTorch and torchvision with the one command from https://pytorch.org (a torchvision from another source does not match your PyTorch). Then:
pip install "nrs-edge[torch]"
nrs-edge run --backend torch --left left.png --right right.png
If you already have your own OpenCV (cv2) or onnxruntime-gpu, install with pip install --no-deps nrs-edge and install numpy and huggingface_hub yourself. Without --no-deps, pip installs opencv-python and the CPU onnxruntime beside your packages, and that can break them.
What you must know
- Accuracy. On our harness (FP32; share of wrong pixels, lower is better): Middlebury-H bad-2 12.71 %, ETH3D bad-1 5.09 %, KITTI 2015 bad-3 5.57 % (not zero-shot: driving images were in the training data), Booster-Q bad-2 28.63 %. These numbers are for the PyTorch path at full picture size. The ONNX path resizes pictures larger than 640 x 480; it has no accuracy numbers of its own. We fixed pass marks before the tests: the weights passed the "Near" mark and failed the "Floor" mark. The model card has every number and every scored candidate.
- Limits. At most 192 px of disparity. No confidence output: glass, mirrors, blank walls and sky get a value that can be wrong. The input must be rectified. Not for safety-critical use without an independent safety layer.
- Platforms. Tested on Windows (x86-64) and on Linux (x86-64 and ARM64), on the CPU. For NVIDIA Jetson the repository has a guide and a TensorRT build script; they have not run on a device.
- Versions. The package version is the version of the code. The weights are
nrs-edge 0.1.0.
Contact: necessityrobotics@gmail.com
Metadata
Release files for nrs-edge 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nrs_edge-0.1.1.tar.gz | 3.9 MB | With provenance | Details for nrs_edge-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nrs_edge-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for nrs_edge-0.1.1-py3-none-any.whl |
Total release size: 7.7 MB
Release files / nrs_edge-0.1.1.tar.gz
| Download URL | nrs_edge-0.1.1.tar.gz |
|---|---|
| Size | 3.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7b570bcd5c5462a397caa5955961249df63a99eaaf2157499ed7970c92159c7
|
|
BLAKE2b-256 checksum How to use checksums |
03942a677913d4b21a405a94f02ac5a89e25c1606f2e454f478ce608ebd623ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logRelease files / nrs_edge-0.1.1-py3-none-any.whl
| Download URL | nrs_edge-0.1.1-py3-none-any.whl |
|---|---|
| Size | 3.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aebce2def9b178d37813209fe871e31b83962b384f374b7f199407e473520df4
|
|
BLAKE2b-256 checksum How to use checksums |
11f3d15624a4fc180d12cd2adc2a2a7bd3d0f014db5483fd913e983a1a31303e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logSecurity for nrs-edge 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for nrs_edge-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.