{"id":20330324,"url":"https://github.com/swintransformer/mim-depth-estimation","last_synced_at":"2026-03-06T07:02:06.787Z","repository":{"id":108884979,"uuid":"587640154","full_name":"SwinTransformer/MIM-Depth-Estimation","owner":"SwinTransformer","description":"This is an official implementation of our CVPR 2023 paper \"Revealing the Dark Secrets of Masked Image Modeling\" on Depth Estimation.","archived":false,"fork":false,"pushed_at":"2023-03-27T05:03:49.000Z","size":508,"stargazers_count":174,"open_issues_count":6,"forks_count":12,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-22T01:43:40.709Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SwinTransformer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-11T08:25:44.000Z","updated_at":"2025-04-10T06:23:23.000Z","dependencies_parsed_at":"2024-12-26T12:45:15.102Z","dependency_job_id":"e263d4db-5ac6-427c-a1f7-d3bea78d8c89","html_url":"https://github.com/SwinTransformer/MIM-Depth-Estimation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SwinTransformer/MIM-Depth-Estimation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwinTransformer%2FMIM-Depth-Estimation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwinTransformer%2FMIM-Depth-Estimation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwinTransformer%2FMIM-Depth-Estimation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwinTransformer%2FMIM-Depth-Estimation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SwinTransformer","download_url":"https://codeload.github.com/SwinTransformer/MIM-Depth-Estimation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwinTransformer%2FMIM-Depth-Estimation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30164890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T04:43:31.446Z","status":"ssl_error","status_checked_at":"2026-03-06T04:40:30.133Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T20:15:54.232Z","updated_at":"2026-03-06T07:02:06.702Z","avatar_url":"https://github.com/SwinTransformer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Revealing the Dark Secrets of Masked Image Modeling (Depth Estimation) [[Paper]](https://arxiv.org/abs/2205.13543)\n\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/revealing-the-dark-secrets-of-masked-image/monocular-depth-estimation-on-nyu-depth-v2)](https://paperswithcode.com/sota/monocular-depth-estimation-on-nyu-depth-v2?p=revealing-the-dark-secrets-of-masked-image)\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/revealing-the-dark-secrets-of-masked-image/monocular-depth-estimation-on-kitti-eigen)](https://paperswithcode.com/sota/monocular-depth-estimation-on-kitti-eigen?p=revealing-the-dark-secrets-of-masked-image)\n\n### Main results\n#### Results on NYUv2\n| Backbone | d1 | d2 | d3 | abs_rel | rmse | rmse_log |\n|-------------------|-------|-------|--------|--------|--------|-------|\n| **Swin-v2-Base** |  0.935 | 0.991 | 0.998 | 0.044 | 0.304 | 0.109 | \n| **Swin-v2-Large** |  0.949 | 0.994 | 0.999 | 0.036 | 0.287 | 0.102 | \n\n#### Results on KITTI\n| Backbone | d1 | d2 | d3 | abs_rel | rmse | rmse_log |\n|-------------------|-------|-------|--------|--------|--------|-------|\n| **Swin-v2-Base** |  0.976 | 0.998 | 0.999 | 0.052 | 2.050 | 0.078 |\n| **Swin-v2-Large** |  0.977 | 0.998   | 1.000 | 0.050 | 1.966 | 0.075 | \n\n### Preparation\nPlease refer to [[GLPDepth]](https://github.com/vinvino02/GLPDepth) for configuring the environment and preparing the NYUV2 and KITTI datasets. \nYou can download pretrained models and our well-trained models from zoo([OneDrive](https://mailustceducn-my.sharepoint.com/:f:/g/personal/aa397601_mail_ustc_edu_cn/EkoYQyhiD6hJu9CGYLOwiF8BRqHgk8kX61NUcyfmdOUV7Q?e=h2uctw)).\n\n\n### Training\n\n\n- Training with model (NYU Depth V2 Swin-Base)\n  \n  ```\n  $ python3 train.py --dataset nyudepthv2 --data_path ../data/ --max_depth 10.0 --max_depth_eval 10.0  --backbone swin_base_v2 --depths 2 2 18 2 --num_filters 32 32 32 --deconv_kernels 2 2 2 --window_size 30 30 30 15 --pretrain_window_size 12 12 12 6 --use_shift True True False False --flip_test --shift_window_test --shift_size 2 --pretrained weights/swin_v2_base_simmim.pth --save_model --crop_h 480 --crop_w 480 --layer_decay 0.9 --drop_path_rate 0.3 --log_dir logs/ \n  ```\n\n- Training with model (NYU Depth V2 Swin-Large)\n  \n  ```\n  $ python3 train.py --dataset nyudepthv2 --data_path ../data/ --max_depth 10.0 --max_depth_eval 10.0  --backbone swin_large_v2 --depths 2 2 18 2 --num_filters 32 32 32 --deconv_kernels 2 2 2 --window_size 30 30 30 15 --pretrain_window_size 12 12 12 6 --use_shift True True False False --flip_test --shift_window_test --shift_size 2 --pretrained weights/swin_v2_large_simmim.pth --save_model --crop_h 480 --crop_w 480 --layer_decay 0.85 --drop_path_rate 0.5 --log_dir logs/ \n  ```\n\n- Training with model (KITTI Swin-Base)\n  \n  ```\n  $ python3 train.py --dataset kitti --kitti_crop garg_crop --data_path ../data/ --max_depth 80.0 --max_depth_eval 80.0 --backbone swin_base_v2 --depths 2 2 18 2 --num_filters 32 32 32 --deconv_kernels 2 2 2 --window_size 22 22 22 11 --pretrain_window_size 12 12 12 6 --use_shift True True False False --flip_test --shift_window_test --shift_size 16 --pretrained weights/swin_v2_base_simmim.pth --save_model --crop_h 352 --crop_w 352 --layer_decay 0.9 --drop_path_rate 0.3 --log_dir logs/ \n  ```\n\n- Training with model (KITTI Swin-Large)\n  \n  ```\n  $ python3 train.py --dataset kitti --kitti_crop garg_crop --data_path ../data/ --max_depth 80.0 --max_depth_eval 80.0 --backbone swin_large_v2 --depths 2 2 18 2 --num_filters 32 32 32 --deconv_kernels 2 2 2 --window_size 22 22 22 11 --pretrain_window_size 12 12 12 6 --use_shift True True False False --flip_test --shift_window_test --shift_size 16 --pretrained weights/swin_v2_large_simmim.pth --save_model --crop_h 352 --crop_w 352 --layer_decay 0.85 --drop_path_rate 0.5 --log_dir logs/ \n  ```\n\n\n#### Evaluation\n\n\n- Evaluate with model (NYU Depth V2 Swin-Base)\n  \n  ```\n  $ python3 test.py --dataset nyudepthv2 --data_path ../data/ --max_depth 10.0 --max_depth_eval 10.0  --backbone swin_base_v2 --depths 2 2 18 2 --num_filters 32 32 32 --deconv_kernels 2 2 2 --window_size 30 30 30 15 --pretrain_window_size 12 12 12 6 --use_shift True True False False --flip_test --shift_window_test --shift_size 2 --do_evaluate --ckpt_dir ckpt/nyudepthv2_swin_base.ckpt\n  ```\n\n- Evaluate with model (NYU Depth V2 Swin-Large)\n  \n  ```\n  $ python3 test.py --dataset nyudepthv2 --data_path ../data/ --max_depth 10.0 --max_depth_eval 10.0  --backbone swin_large_v2 --depths 2 2 18 2 --num_filters 32 32 32 --deconv_kernels 2 2 2 --window_size 30 30 30 15 --pretrain_window_size 12 12 12 6 --use_shift True True False False --flip_test --shift_window_test --shift_size 2 --do_evaluate --ckpt_dir ckpt/nyudepthv2_swin_large.ckpt\n  ```\n\n- Evaluate with model (KITTI Swin-Base)\n  \n  ```\n  $ python3 test.py --dataset kitti --kitti_crop garg_crop --data_path ../data/ --max_depth 80.0 --max_depth_eval 80.0 --backbone swin_base_v2 --depths 2 2 18 2 --num_filters 32 32 32 --deconv_kernels 2 2 2 --window_size 22 22 22 11 --pretrain_window_size 12 12 12 6 --use_shift True True False False --flip_test --shift_window_test --shift_size 16 --do_evaluate --ckpt_dir ckpt/kitti_swin_base.ckpt\n  ```\n\n- Evaluate with model (KITTI Swin-Large)\n  \n  ```\n  $ python3 test.py --dataset kitti --kitti_crop garg_crop --data_path ../data/ --max_depth 80.0 --max_depth_eval 80.0 --backbone swin_large_v2 --depths 2 2 18 2 --num_filters 32 32 32 --deconv_kernels 2 2 2 --window_size 22 22 22 11 --pretrain_window_size 12 12 12 6 --use_shift True True False False --flip_test --shift_window_test --shift_size 16 --do_evaluate --ckpt_dir ckpt/kitti_swin_large.ckpt\n  ```\n\n### Citation\n\n```\n@article{xie2023darkmim,\n  title={Revealing the Dark Secrets of Masked Image Modeling},\n  author={Zhenda Xie, Zigang Geng, Jingcheng Hu, Zheng Zhang, Han Hu, Yue Cao},\n  journal={arXiv preprint arXiv:2205.13543},\n  year={2022}\n}\n```\n\n### Acknowledge\n\nOur code is mainly based on GLPDepth[1]. The code of the model is from SwinTransformer[2] and Simple Baseline[3].\n\n[1] Global-Local Path Networks for Monocular Depth Estimation with Vertical CutDepth. [[code]](https://github.com/vinvino02/GLPDepth)\n\n[2] Swin Transformer: Hierarchical Vision Transformer using Shifted Windows. [[code]](https://github.com/microsoft/Swin-Transformer)\n\n[3] Simple Baselines for Human Pose Estimation and Tracking. [[code]](https://github.com/microsoft/human-pose-estimation.pytorch)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswintransformer%2Fmim-depth-estimation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswintransformer%2Fmim-depth-estimation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswintransformer%2Fmim-depth-estimation/lists"}