{"id":22283610,"url":"https://github.com/ashok-arjun/monocular-depth-estimation","last_synced_at":"2025-07-28T21:32:48.104Z","repository":{"id":37666805,"uuid":"278440645","full_name":"ashok-arjun/Monocular-Depth-Estimation","owner":"ashok-arjun","description":"Depth estimation from single-view RGB images","archived":false,"fork":false,"pushed_at":"2022-11-22T09:48:35.000Z","size":58870,"stargazers_count":5,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-05T07:42:45.108Z","etag":null,"topics":["computer-vision","deep-learning","depth-estimation","machine-learning","monocular-depth-estimation","pytorch","research"],"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/ashok-arjun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-09T18:25:48.000Z","updated_at":"2023-03-05T07:42:45.109Z","dependencies_parsed_at":"2022-09-09T05:54:05.533Z","dependency_job_id":null,"html_url":"https://github.com/ashok-arjun/Monocular-Depth-Estimation","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashok-arjun%2FMonocular-Depth-Estimation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashok-arjun%2FMonocular-Depth-Estimation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashok-arjun%2FMonocular-Depth-Estimation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashok-arjun%2FMonocular-Depth-Estimation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashok-arjun","download_url":"https://codeload.github.com/ashok-arjun/Monocular-Depth-Estimation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227960041,"owners_count":17847728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["computer-vision","deep-learning","depth-estimation","machine-learning","monocular-depth-estimation","pytorch","research"],"created_at":"2024-12-03T16:41:21.925Z","updated_at":"2024-12-03T16:41:22.663Z","avatar_url":"https://github.com/ashok-arjun.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![DOI](https://zenodo.org/badge/278440645.svg)](https://zenodo.org/badge/latestdoi/278440645)\r\n\u003cimg src=\"https://img.shields.io/badge/python%20-%2314354C.svg?\u0026style=for-the-badge\u0026logo=python\u0026logoColor=white\"/\u003e \u003cimg src=\"https://img.shields.io/badge/PyTorch%20-%23EE4C2C.svg?\u0026style=for-the-badge\u0026logo=PyTorch\u0026logoColor=white\" /\u003e\r\n\r\n\r\n# Perceptual Dense Network for High-Quality Monocular Depth Estimation\r\n\r\nHere, we propose an approach that integrates learning **low level** and **high level features** to estimate **high-quality depth maps** from **single-view 2-D images**\r\n\r\nA deep **fully convolutional architecture** and suitable optimization objectives that minimize **a set of per-pixel loss functions** and **a perceptual loss function**, along with augmentation and training strategies has been employed.\r\n\r\n# Results\r\n\r\n\r\n## Qualitative\r\n\r\n| Input RGB Image | Ground truth depth map | Our results|\r\n|:---------------:|:----------------------:|:----------:|\r\n|![](docs/image.png)|![](docs/gt.png)|![](docs/pred.png)|\r\n|![](docs/image2.png)|![](docs/gt2.png)|![](docs/pred2.png)|\r\n\r\n## Quantitative\r\n\r\n|\u003cimg src=\"https://render.githubusercontent.com/render/math?math=\\delta_1 \\uparrow\"\u003e | \u003cimg src=\"https://render.githubusercontent.com/render/math?math=\\delta_2 \\uparrow\"\u003e |\u003cimg src=\"https://render.githubusercontent.com/render/math?math=\\delta_3 \\uparrow\"\u003e|\u003cimg src=\"https://render.githubusercontent.com/render/math?math=rel \\downarrow\"\u003e|\u003cimg src=\"https://render.githubusercontent.com/render/math?math=rms\\downarrow\"\u003e|\u003cimg src=\"https://render.githubusercontent.com/render/math?math=log_{10}\\downarrow\"\u003e\r\n| :--------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------:| :--------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------: \r\n|0.852 | 0.976 | 0.995 | 0.122 | 0.500 | 0.053\r\n# Instructions\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\r\n  \u003cb\u003eInstallation\u003c/b\u003e \r\n\u003c/summary\u003e\r\n\r\nTo install, execute\r\n\r\n```\r\npip install -r requirements.txt\r\n```\r\n  \r\n\u003c/details\u003e\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\r\n  \u003cb\u003eData\u003c/b\u003e\r\n\u003c/summary\u003e\r\n  \r\n[NYU Depth v2 train](https://tinyurl.com/nyu-data-zip)  - (50K images) (4.1 GB)\r\n\r\nOn extraction, there will be a ```data``` folder.\r\n\r\n[NYU Depth v2 test](https://s3-eu-west-1.amazonaws.com/densedepth/nyu_test.zip) - (654 images) (1 GB)\r\n  \r\nOn extraction, there will be three ```.npy``` files.\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\r\n  \u003cb\u003eTraining\u003c/b\u003e\r\n\u003c/summary\u003e\r\n  \r\nThe script ```train.py``` contains the code for training the model. It can be invoked with the following arguments:\r\n  \r\n```\r\nusage: train.py [-h] --train_dir TRAIN_DIR --test_dir TEST_DIR --batch_size\r\n                BATCH_SIZE --checkpoint_dir CHECKPOINT_DIR --epochs EPOCHS\r\n                [--checkpoint CHECKPOINT] [--lr LR]\r\n                [--log_interval LOG_INTERVAL] [--backbone BACKBONE]\r\n                [--test_batch_size TEST_BATCH_SIZE]\r\n                [--perceptual_weight PERCEPTUAL_WEIGHT]\r\n\r\nTraining of depth estimation model\r\n\r\n  -h, --help            show this help message and exit\r\n\r\nmandatory arguments:\r\n  --train_dir TRAIN_DIR\r\n                        Train directory path - should contain the 'data'\r\n                        folder\r\n  --test_dir TEST_DIR   Test directory path - should contain 3 files\r\n  --batch_size BATCH_SIZE\r\n                        Batch size to process the train data\r\n  --checkpoint_dir CHECKPOINT_DIR\r\n                        Directory to save checkpoints in\r\n  --epochs EPOCHS       Number of epochs\r\n  \r\noptional arguments:\r\n  --checkpoint CHECKPOINT\r\n                        Model checkpoint path\r\n  --lr LR               Learning rate\r\n  --log_interval LOG_INTERVAL\r\n                        Interval to print the avg. loss and metrics\r\n  --backbone BACKBONE   Model backbone: densenet161 or densenet121\r\n  --test_batch_size TEST_BATCH_SIZE\r\n                        Batch size for frequent testing\r\n  --perceptual_weight PERCEPTUAL_WEIGHT\r\n                        Weight for the perceptual loss\r\n\r\n```\r\n\r\nIt is advised to run the code on a GPU. The code automatically detects if a GPU is available, and uses it.\r\n\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\r\n  \u003cb\u003eEvaluation/Inference\u003c/b\u003e\r\n\u003c/summary\u003e\r\n  \r\nThe script ```evaluate.py``` contains the code for evaluating the model/for predicting the depth given an image. It can be invoked with the following arguments:\r\n\r\n```\r\n\r\nusage: evaluate.py [-h] --model MODEL [--data_dir DATA_DIR] [--img IMG]\r\n                   [--batch_size BATCH_SIZE] [--output_dir OUTPUT_DIR]\r\n                   [--backbone BACKBONE]\r\n\r\nEvaluation of depth estimation model on either test data/own images\r\n\r\n  -h, --help            show this help message and exit\r\n\r\narguments:\r\n  --model MODEL         Model checkpoint path\r\n  --data_dir DATA_DIR   Test data directory(If evaluation on test data)\r\n  --img IMG             Image path(If evaluation on a single image)\r\n  --batch_size BATCH_SIZE\r\n                        Batch size to process the test data\r\n  --output_dir OUTPUT_DIR\r\n                        Directory to save output depth images\r\n  --backbone BACKBONE   Model backbone - densenet 121 or densenet 161\r\n\r\n```\r\n\r\nIt is advised to run the code on a GPU. The code automatically detects if a GPU is available, and uses it.\r\n\r\n\u003c/details\u003e\r\n\r\n# Citation\r\n\r\nPlease cite the following if you find the code useful in your research:\r\n\r\n```\r\n@misc{Ashok2020,\r\n  author = {Ashok, Arjun},\r\n  title = {Perceptual Dense Network for High-Quality Monocular Depth Estimation},\r\n  year = {2020},\r\n  publisher = {Zenodo},\r\n  doi = {10.5281/zenodo.4041690},\r\n  version = {1.0},\r\n  url = {https://doi.org/10.5281/zenodo.4041690}\r\n}\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashok-arjun%2Fmonocular-depth-estimation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashok-arjun%2Fmonocular-depth-estimation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashok-arjun%2Fmonocular-depth-estimation/lists"}