File size: 6,975 Bytes
87e736d 28c3e6e 87e736d 28c3e6e 60983a4 28c3e6e 60983a4 28c3e6e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | ---
license: mit
tags:
- monocular-depth-estimation
- self-supervised
- autonomous-driving
- yolo
- pytorch
- kitti
- cityscapes
library_name: pytorch
pipeline_tag: depth-estimation
---
**Towards Robust Driving Perception: A Flexible Scale-Driven Family for Self-Supervised Monocular Depth Estimation**
[](https://eccv.ecva.net/)
[](https://arxiv.org/abs/2607.00736)
[](https://startnew.github.io/projects/flexdepth/)
[](https://github.com/StarNew/FlexDepth)
## Overview
FlexDepth is a family of self-supervised monocular depth estimation models designed for robust driving perception. It introduces a **Scale-Driven Decoder (SDD)** with adaptive component selection, enabling a single architecture to span five model scales β from ultra-lightweight (1.5M params, 0.7 GFLOPs) to high-accuracy (32.3M params, 24.6 GFLOPs).
### Key Features
- **Five model scales**: Nano (N), Small (S), Medium (M), Large (L), X-Large (X)
- **Scale-Driven Decoder (SDD)**: Adaptive component selection based on model scale
- **High-Efficiency Bottleneck (HEB)**: For small models (N, S) β maximizes efficiency
- **High-Performance Bottleneck (HPB)**: For large models (M, L, X) β maximizes accuracy
- **Dynamic upsampling**: Sharper depth boundaries via learned upsampling
- **Two-stage static-dynamic decoupled training**: Handles dynamic scenes in driving scenarios
- **YOLO11-based encoder**: Leverages rich visual representations from YOLO segmentation pretraining
## Model Zoo
### KITTI-trained Models
| Model | Params | GFLOPs | Abs Rel β | Sq Rel β | RMSE β | RMSE log β | Ξ΄<1.25 β | Ξ΄<1.25Β² β | Ξ΄<1.25Β³ β |
|-------|--------|--------|-----------|----------|--------|------------|----------|-----------|-----------|
| Flex-Nano | 1.5M | 0.7 | 0.110 | 0.794 | 4.678 | 0.184 | 0.878 | 0.961 | 0.983 |
| Flex-Small | 6.1M | 2.8 | 0.104 | 0.713 | 4.458 | 0.179 | 0.890 | 0.964 | 0.983 |
| Flex-Medium | 12.7M | 10.0 | 0.096 | 0.639 | 4.253 | 0.172 | 0.903 | 0.968 | 0.985 |
| Flex-Large | 15.2M | 11.5 | 0.095 | 0.642 | 4.199 | 0.171 | 0.906 | 0.968 | 0.984 |
| Flex-X-Large | 32.3M | 24.6 | **0.093** | **0.605** | **4.114** | **0.167** | **0.910** | **0.969** | **0.985** |
### Cityscapes-trained Models
| Model | Params | GFLOPs | Abs Rel β | Sq Rel β | RMSE β | RMSE log β | Ξ΄<1.25 β | Ξ΄<1.25Β² β | Ξ΄<1.25Β³ β |
|-------|--------|--------|-----------|----------|--------|------------|----------|-----------|-----------|
| Flex-Nano | 1.5M | 0.6 | 0.107 | 1.261 | 6.133 | 0.164 | 0.893 | 0.971 | 0.989 |
| Flex-Small | 6.1M | 2.2 | 0.100 | 1.078 | 5.813 | 0.153 | 0.904 | 0.975 | 0.991 |
| Flex-Medium | 12.7M | 8.0 | 0.089 | 0.885 | 5.358 | 0.143 | 0.917 | 0.979 | 0.993 |
| Flex-Large | 15.2M | 9.2 | 0.087 | 0.911 | 5.310 | 0.139 | 0.924 | 0.981 | 0.993 |
| Flex-X-Large | 32.3M | 19.7 | **0.086** | **0.877** | **5.268** | **0.137** | **0.926** | **0.982** | **0.993** |
### Efficiency
| Model | FPS (Snapdragon 8 Elite)(bs 1) | FPS (RTX 2080 Ti)(bs 16) |
|-------|--------------------------|---------------------|
| Flex-Nano | 37.6 | 547 |
| Flex-Small | 18.6 | 487 |
| Flex-Medium | 5.8 | 160 |
| Flex-Large | 5.2 | 153 |
| Flex-X-Large | 3.0 | 98 |
## Model Files
Each model consists of two weight files:
```
βββ kitti/
β βββ flex_n/
β β βββ encoder.pth # YOLO11-based encoder weights
β β βββ depth.pth # Scale-Driven Decoder weights
β βββ flex_s/
β βββ flex_m/
β βββ flex_l/
β βββ flex_x/
βββ cs/
βββ flex_n/
βββ flex_s/
βββ flex_m/
βββ flex_l/
βββ flex_x/
```
## Usage
### Installation
```bash
conda create -n flexdepth python=3.10
conda activate flexdepth
pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cu118
pip install -r requirements.txt
```
### Download Weights
```python
from huggingface_hub import snapshot_download
# Download all models
snapshot_download(repo_id="StarNew/flexdepth", local_dir="./models")
# Or download a specific model
from huggingface_hub import hf_hub_download
hf_hub_download(
repo_id="StarNew/flexdepth",
filename="kitti/flex_n/encoder.pth",
local_dir="./models"
)
hf_hub_download(
repo_id="StarNew/flexdepth",
filename="kitti/flex_n/depth.pth",
local_dir="./models"
)
```
### Evaluation
```bash
# Flex-Nano on KITTI
python evaluate_depth.py --png --eval_mono --scale 4 \
--encoder_model_type yolo11n-seg --decoder_model_type flexn \
--load_weights_folder ./models/kitti/flex_n \
--data_path <kitti_data_path> --split_path <splits_path>
# Flex-X-Large on KITTI
python evaluate_depth.py --png --eval_mono --scale 4 \
--encoder_model_type yolo11x-seg --decoder_model_type flexx \
--load_weights_folder ./models/kitti/flex_x \
--data_path <kitti_data_path> --split_path <splits_path>
```
### ONNX Export
```bash
python export_onnx.py --encoder_model_type yolo11n-seg --decoder_model_type flexn \
--load_weights_folder ./models/kitti/flex_n --scales 4 --export_name flex-n
```
## Comparison with Depth Anything V2
On the KITTI Eigen benchmark with dense ground truth and least-squares alignment:
| Method | Type | Params | GFLOPs | Resolution | Abs Rel β | Ξ΄<1.25 β |
|--------|------|--------|--------|------------|-----------|----------|
| DA2 (ViT-L) | Zero-Shot | 335M | 1947 | 1722Γ518 | 0.070 | **0.956** |
| DA2 (ViT-S) | Zero-Shot | 25M | 137 | 1722Γ518 | 0.077 | 0.944 |
| DA2 (ViT-L) | Zero-Shot | 335M | 276 | 644Γ196 | 0.092 | 0.915 |
| DA2 (ViT-S) | Zero-Shot | 25M | 19 | 644Γ196 | 0.110 | 0.881 |
| **Flex-X-Large** | Self-Supervised | 32M | 25 | 640Γ192 | **0.063** | 0.952 |
FlexDepth achieves comparable or better accuracy than Depth Anything V2 with **~13Γ fewer parameters** and **~78Γ fewer GFLOPs** at similar resolution.
## Citation
```bibtex
@misc{zhu2026robustdrivingperceptionflexible,
title={Towards Robust Driving Perception: A Flexible Scale-Driven Family for Self-Supervised Monocular Depth Estimation},
author={Zhaowen Zhu and Li Zhang and Yujie Chen and Tian Zhang and Yingjie Wang and Mingxia Zhan},
year={2026},
eprint={2607.00736},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2607.00736}
}
```
## Acknowledgment
This work is supported by the National Natural Science Foundation of China under Grant 62332016.
Our code is built upon [Monodepth2](https://github.com/nianticlabs/monodepth2), [Manydepth](https://github.com/nianticlabs/manydepth), and [Ultralytics](https://github.com/ultralytics/ultralytics).
|