Upload README.md with huggingface_hub
Browse files123---license: agpl-3.0---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181---license: mittags:- monocular-depth-estimation- self-supervised- autonomous-driving- yolo- pytorch- kitti- cityscapeslibrary_name: pytorchpipeline_tag: depth-estimation---# FlexDepth: A Flexible Scale-Driven Family for Self-Supervised Monocular 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)## OverviewFlexDepth 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) | FPS (RTX 2080 Ti) ||-------|--------------------------|---------------------|| Flex-Nano | 37.6 | 180+ || Flex-Small | 18.6 | 120+ || Flex-Medium | 5.8 | 60+ || Flex-Large | 5.2 | 55+ || Flex-X-Large | 3.0 | 40+ |## Model FilesEach 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```bashconda create -n flexdepth python=3.10conda activate flexdepthpip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cu118pip install -r requirements.txt```### Download Weights```pythonfrom huggingface_hub import snapshot_download# Download all modelssnapshot_download(repo_id="StarNew/flexdepth", local_dir="./models")# Or download a specific modelfrom huggingface_hub import hf_hub_downloadhf_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 KITTIpython 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 KITTIpython 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```bashpython 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 V2On 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}}```## AcknowledgmentThis 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).
README.md+179-1