TinyDepth-Robot (1.36M params)

A tiny monocular relative depth model for robots and edge devices. It was distilled from Depth-Anything-V2-Small (24.8M params) into a 1.36M-parameter MobileNetV4-Small encoder with a depthwise-separable FPN decoder, which makes it about 18ร— smaller than the teacher. Training was done entirely on CPU.

demo Left to right: RGB, teacher (Depth-Anything-V2-Small), TinyDepth.

Output

disparity (B, H, W): relative inverse depth, where larger values are closer. The values have no scale. For metric depth, fit a scale and shift per scene (for example from a known floor plane or a few lidar points), or use the map directly for obstacle and free-space reasoning.

Usage

pip install torch timm safetensors opencv-python   # or just onnxruntime opencv-python for --onnx
python inference.py image.jpg            # -> image_depth.png
python inference.py image.jpg --onnx
python inference.py --webcam

Input: RGB, ImageNet-normalized, default 320x240 (H and W should be multiples of 32).

Results (DIODE val, n=167, scale and shift aligned to ground truth)

Model Params AbsRel โ†“ ฮด1 โ†‘
Depth-Anything-V2-Small (teacher) 24.8M 0.213 0.736
TinyDepth-Robot 1.36M 0.266 0.635

Both models were evaluated at 320x240 (the teacher's predictions were made at 392x294 and then resized).

Training

  • Data: about 2.8k DIODE indoor and outdoor images. Labels were pseudo-labels from the teacher, so no ground truth was used in training.
  • Loss: scale-and-shift-invariant L1 (MiDaS median/MAD normalization) plus a multi-scale gradient-matching loss.
  • Optimizer and schedule: AdamW with a OneCycle schedule, 15 epochs, batch size 16, 288x224 random crops, horizontal flips and color jitter. The best checkpoint was from epoch 12.
  • Encoder: mobilenetv4_conv_small.e2400_r224_in1k, initialized from ImageNet.

Limitations

  • Outputs relative depth only; it does not predict metric depth.
  • Low resolution, so thin structures such as chair legs and wires may be missed.
  • Trained on a small dataset, so it may degrade in unusual domains such as underwater scenes or extreme lighting.
  • Not safety-certified. Do not use it as the only collision-avoidance sensor.

Files

model.safetensors (PyTorch weights), tinydepth.onnx, model.py, inference.py

Downloads last month

-

Downloads are not tracked for this model. How to track
Safetensors
Model size
1.38M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for Zaidoppa/tinydepth-robot

Quantized
(16)
this model

Dataset used to train Zaidoppa/tinydepth-robot