Downloads · 30 days
0
Heliosoph/midas-small-onnx
midas-small-onnx is a depth estimation model from Heliosoph. Use it for the depth estimation task on the model card, and read the license before you ship it in a product. It is set up for onnx. The card lists the license as mit.
ONNX checkpoint of Intel ISL's MiDaS v2.1 small — an EfficientNet-Lite3 encoder paired with a lightweight depth decoder. ~21M params, 256×256 input, CPU-friendly. Sibling to DPT-Large but ~16× smaller and ~20× faster…
Downloads · 30 days
0
Access
Public
Updated May 18, 2026
Repo size
66.4 MB
Likes
0
Public
Click a slice to open those files.
.onnx66.4 MB · 100%
From the Hugging Face model README
ONNX checkpoint of Intel ISL's MiDaS v2.1 small — an EfficientNet-Lite3 encoder paired with a lightweight depth decoder. ~21M params, 256×256 input, CPU-friendly. Sibling to DPT-Large but ~16× smaller and ~20× faster on CPU.
Not converted locally — this is the ONNX file isl-org publishes directly in the v2_1 GitHub release.
Credit: Intel Intelligent Systems Lab (MiDaS team — Ranftl, Lasinger, Hafner, Schindler, Koltun).
midas_v21_small_256.onnx # ~80 MB — fp32, EfficientNet-Lite3 backbone, 256×256 input
A single ONNX file. No tokenizer, no preprocessor config — preprocessing is fixed by the architecture convention.
| Spec | |
|---|---|
| Input name | input.1 (verify in Netron) |
| Input shape | [1, 3, 256, 256] (NCHW) |
| Input dtype | float32 |
| Input color order | BGR — note this differs from DPT-Large (which expects RGB) |
| Preprocessing | Resize to 256×256, scale to [0,1], normalize with ImageNet stats: mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225] |
| Output shape | [1, 256, 256] |
| Output meaning | Single-channel relative depth (higher = closer, lower = farther). Not metric. Linearly map to your visualization range. |
import onnxruntime as ort
import numpy as np
from PIL import Image
sess = ort.InferenceSession("midas_v21_small_256.onnx")
# Resize, BGR (note: PIL is RGB by default — swap channels for MiDaS-small)
img = Image.open("photo.jpg").convert("RGB").resize((256, 256))
arr = np.asarray(img, dtype=np.float32) / 255.0
arr = arr[..., ::-1] # RGB -> BGR
arr = (arr - [0.485, 0.456, 0.406]) / [0.229, 0.224, 0.225] # ImageNet normalize
arr = arr.transpose(2, 0, 1)[None, ...].copy().astype(np.float32) # NCHW
depth = sess.run(None, {sess.get_inputs()[0].name: arr})[0][0] # 256x256
For metric depth, pair with a calibration scheme — MiDaS is trained for relative depth and will not give you "this object is 1.7 m away" without further work.
For sharper boundaries and higher absolute quality (at ~16× the disk + GPU latency), reach for dpt-large instead — same model family, same upstream lab.
MIT — same as the upstream isl-org/MiDaS repo. LICENSE file included.
Note: a separate Intel-published variant of DPT-Large lives on HuggingFace at Intel/dpt-large under Apache-2.0. Same model family, different distribution channel, different licenses. The checkpoint in this repo (v2_1 GitHub release) inherits MIT from the upstream GitHub repo.