A compressed version of Depth Anything 3 Small for monocular depth estimation, produced with SmolAnything: structured pruning and low-rank replacements fitted on unlabeled calibration images, with an LLM (Claude Opus 5.5, medium effort) deciding what to cut. No retraining, no labels.
| Original | This model | |
|---|---|---|
| Parameters | 25.8M | 18.5M (−28.1%) |
| MACs (378×504 input) | 37.6G | 32.8G (−12.8%) |
| NYUv2 test AbsRel ↓ | 0.10712 | 0.10714 |
| NYUv2 test δ1 ↑ | 0.88207 | 0.88216 |
| DIODE val AbsRel ↓, indoor / outdoor | 0.10999 / 0.42684 | 0.11039 / 0.42477 |
| DIODE val δ1 ↑, indoor / outdoor | 0.87414 / 0.64284 | 0.87522 / 0.64149 |
| Latency, RTX 3070 Ti (ONNX Runtime, CUDA) | 14.4 ms | 11.7 ms (−18.8%) |
| Latency, CPU, Ryzen 5 5600X (ONNX Runtime) | 252 ms | 174 ms (−31.0%) |
| ONNX file size | 104.7 MB | 86.5 MB (−17.4%) |
The parameter reduction is 23.5% from compression (17 verified edits) plus 4.6% from removing the camera decoder, which only serves the camera-pose outputs. Part of the latency gain comes from the simplified fixed-shape graph alone (12.6 ms GPU / 190 ms CPU without any edits). Latencies are medians at batch 1, with the models run alternately.
Input image, depth from the original model, depth from this model, relative difference.
pixel_values is 1×1×3×378×504 (batch 1, one view, RGB, height 378, width 504). The original accepts dynamic sizes. Resize images so the longest side is 504 (area interpolation), round both sides to multiples of 14 (a 640×480 image becomes 504×378), scale to [0, 1] and normalize with ImageNet mean (0.485, 0.456, 0.406) and std (0.229, 0.224, 0.225).predicted_depth (1×1×378×504). The confidence, extrinsics and intrinsics outputs of the original were removed. Single-view use only.import numpy as np
import onnxruntime as ort
from huggingface_hub import hf_hub_download
path = hf_hub_download("GavGuile/smolanything-depth-anything-3-small", "onnx/model.onnx")
hf_hub_download("GavGuile/smolanything-depth-anything-3-small", "onnx/model.onnx_data")
session = ort.InferenceSession(path, providers=["CUDAExecutionProvider", "CPUExecutionProvider"])
pixel_values = np.zeros((1, 1, 3, 378, 504), dtype=np.float32) # preprocessed image, see above
depth = session.run(["predicted_depth"], {"pixel_values": pixel_values})[0][0, 0] # (378, 504)
Found and verified by SmolAnything (full report with evidence and reasoning: study report):
projects.2/projects.3 and layer3_rn replaced by low-rank factorizations; one fusion residual unit narrowed.Apache-2.0, like the original model. All credit for the model architecture and training goes to the Depth Anything 3 authors (ByteDance Seed); this repository only contains a post-training compressed version. The ONNX export is based on onnx-community/depth-anything-v3-small.
SmolAnything is an independent project and is not affiliated with Hugging Face or with the authors of Depth Anything.