Instructions to use litert-community/Depth-Anything-3-Small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use litert-community/Depth-Anything-3-Small with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Preserve DA3 Small source behavior in FP16 model
Replace da3_small_gpu_fp16.tflite with the refreshed FP16-weight model,
preserving its public signature, input/output names, shapes, and dtypes. The
model preserves the original interpolation alignment, positional-interpolation
offset, and UV positional refinement. FP16 weights were produced with AI Edge
Quantizer's FLOAT_CASTING16 recipe; public input and output remain float32.
- File size: 55.04 MB → 54.77 MB (55,035,456 → 54,766,600 bytes).
- TFLite operators: 1,460 → 1,153, a 21.0% reduction.
- On ten identical natural-image inputs, pooled relative L2 error against the
original FP32 PyTorch depth output falls from 1.619770% → 0.011686% with
the Linux LiteRT GPU IR backend and FP32 compute. Both models fully accelerate.
This measures source fidelity, not ground-truth depth accuracy. - The replacement model card provides the fixed-shape preprocessing and a
named-signature Python example, while preserving the original Training data & PII
section and historical benchmark results with their original model-revision attribution.
Matched phone medians (same native LiteRT runtime, CPU4 or IR/OpenCL FP32;
ABBA order, five warm-ups and twenty timed runs per group, forty per file/backend/device, using one shared natural-image input):
| Device | Backend | Published FP16 | New FP16 | Latency change |
|---|---|---|---|---|
| TECNO LJ9 | CPU, 4 threads | 2005.9 ms | 2046.7 ms | +2.03% |
| TECNO LJ9 | GPU IR, FP32 | 750.1 ms | 730.5 ms | -2.62% |
| Pixel 8 | CPU, 4 threads | 2312.5 ms | 2435.0 ms | +5.30% |
| Pixel 8 | GPU IR, FP32 | 822.2 ms | 867.5 ms | +5.51% |
Both files fully delegate on both phone GPUs. Outputs are finite and agree
with corresponding host outputs within 3.82e-7 relative L2. This is a
source-fidelity improvement with mixed speed results. CPU measurements drifted
between groups, so small CPU differences should be interpreted cautiously.
Replacement model SHA256:ae153854383ad4599651eb8ac0a6606c9101a29b41609ffad8f43703cf78d7df.
Changed files: da3_small_gpu_fp16.tflite and README.md.
Baseline: published revision 5cd25d9.
Reference: DA3-SMALL checkpoint e08cab6, with upstream code 3d835ec.
The main fidelity improvement comes from preserving three behaviors that the previously published recipe changed:
| Behavior | Previously published file | Proposed replacement | Error caused by that change alone¹ |
|---|---|---|---|
| Depth-head resizing | Changed align_corners=True to False, shifting interpolation sampling positions |
Preserves True |
1.458% |
| UV positional refinement | Disabled the spatial-position signal added to feature maps | Preserves it using compact horizontal/vertical tables | 0.670% |
| Backbone positional interpolation | Baked an explicit output size, omitting the original 0.1 interpolation offset |
Preserves the original interpolation exactly | 0.266% |
¹ Pooled relative L2 error versus the original model on ten identical natural-image inputs. Each behavior was changed independently in FP32 PyTorch, without TFLite execution or quantization. The effects interact; these percentages must not be added. This measures fidelity to PyTorch outputs; accuracy against ground-truth depth was not evaluated.
Applying all three changes together produced 1.6178% error, closely reproducing the published FP16 model's 1.6198% error. The new FP32 TFLite model has approximately 0.000052% error on the host GPU; FP16 weight rounding raises that to 0.011686%. This attributes nearly all of the previous discrepancy to the three source-behavior changes above.
The model card now also retains the original Training data & PII, Performance, Snapdragon NPU (Hexagon), and Raspberry Pi 5 (CPU) sections. The retained benchmark results are labeled as measurements of the previous published model.