{"id":20885254,"url":"https://github.com/svip-lab/indoor-sfmlearner","last_synced_at":"2025-05-12T19:30:42.249Z","repository":{"id":37392646,"uuid":"279753917","full_name":"svip-lab/Indoor-SfMLearner","owner":"svip-lab","description":"[ECCV'20] Patch-match and Plane-regularization for Unsupervised Indoor Depth Estimation","archived":false,"fork":false,"pushed_at":"2022-11-07T20:23:12.000Z","size":1783,"stargazers_count":142,"open_issues_count":4,"forks_count":24,"subscribers_count":9,"default_branch":"master","last_synced_at":"2023-10-20T23:18:20.620Z","etag":null,"topics":["depth-estimation","eccv2020","extract-superpixel","indoor","nyuv2","pose-estimation","pytorch","scannet","self-supervised","unsupervised-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/svip-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-15T03:33:36.000Z","updated_at":"2023-08-11T15:17:32.000Z","dependencies_parsed_at":"2023-01-20T20:18:00.953Z","dependency_job_id":null,"html_url":"https://github.com/svip-lab/Indoor-SfMLearner","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svip-lab%2FIndoor-SfMLearner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svip-lab%2FIndoor-SfMLearner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svip-lab%2FIndoor-SfMLearner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svip-lab%2FIndoor-SfMLearner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/svip-lab","download_url":"https://codeload.github.com/svip-lab/Indoor-SfMLearner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225148874,"owners_count":17428430,"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":["depth-estimation","eccv2020","extract-superpixel","indoor","nyuv2","pose-estimation","pytorch","scannet","self-supervised","unsupervised-learning"],"created_at":"2024-11-18T08:12:55.721Z","updated_at":"2024-11-18T08:12:55.779Z","avatar_url":"https://github.com/svip-lab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Indoor SfMLearner\n\nPyTorch implementation of our ECCV2020 paper:\n\n[P\u003csup\u003e2\u003c/sup\u003eNet: Patch-match and Plane-regularization for Unsupervised Indoor Depth Estimation](https://arxiv.org/pdf/2007.07696.pdf)\n\nZehao Yu\\*,\nLei Jin\\*,\n[Shenghua Gao](http://sist.shanghaitech.edu.cn/sist_en/2018/0820/c3846a31775/page.htm)\n\n(\\* Equal Contribution)\n\n\u003cimg src=\"asserts/pipeline.png\" width=\"800\"\u003e\n\n## Getting Started\n\n### Installation\n```bash\npip install -r requirements.txt\n```\nThen install pytorch with\n```bash\nconda install pytorch torchvision cudatoolkit=10.2 -c pytorch\n```\nPytorch version \u003e= 0.4.1 would work well.\n\n### Download pretrained model\nPlease download pretrained model from [Onedrive](https://onedrive.live.com/?authkey=%21ANXK7icE%2D33VPg0\u0026id=C43E510B25EDDE99%21106\u0026cid=C43E510B25EDDE99) and extract:\n```bash\ntar -xzvf ckpts.tar.gz \nrm ckpts.tar.gz\n```\n\n### Prediction on single image                                                                                  \nRun the following command to predict on a single image:\n```bash\npython inference_single_image.py --image_path=/path/to/image\n```\nBy default, the script saves the predicted depth to the same folder\n\n## Evaluation                                                                                                     \nDownload testing data from [Onedrive](https://onedrive.live.com/?authkey=%21ANXK7icE%2D33VPg0\u0026id=C43E510B25EDDE99%21106\u0026cid=C43E510B25EDDE99) and put to ./data.\n```bash\ncd data\ntar -xzvf nyu_test.tar.gz \ntar -xzvf scannet_test.tar.gz\ntar -xzvf scannet_pose.tar.gz\ncd ../\n```\n\n### NYUv2 Dpeth\n```bash\nCUDA_VISIBLE_DEVICES=1 python evaluation/nyuv2_eval_depth.py \\\n    --data_path ./data \\\n    --load_weights_folder ckpts/weights_5f \\\n    --post_process  \n```\n\n### NYUv2 normal\n```base\nCUDA_VISIBLE_DEVICES=1 python evaluation/nyuv2_eval_norm.py \\\n    --data_path ./data \\\n    --load_weights_folder ckpts/weights_5f \\\n    # --post_process\n```\n\n### ScanNet Depth\n```base\nCUDA_VISIBLE_DEVICES=1 python evaluation/scannet_eval_depth.py \\                                               \n    --data_path ./data/scannet_test \\\n    --load_weights_folder ckpts/weights_5f \\\n    --post_process\n```\n\n### ScanNet Pose\n```base\nCUDA_VISIBLE_DEVICES=1 python evaluation/scannet_eval_pose.py \\\n    --data_path ./data/scannet_pose \\\n    --load_weights_folder ckpts/weights_5f \\\n    --frame_ids 0 1\n```\n\n## Training\nFirst download [NYU Depth V2](https://cs.nyu.edu/~silberman/datasets/nyu_depth_v2.html) on the official website and unzip the raw data to DATA_PATH.\n\n### Extract Superpixel\nRun the following command to extract superpixel:\n```bash\npython extract_superpixel.py --data_path DATA_PATH --output_dir ./data/segments\n```\n\n### 3-frames\nRun the following command to train our network:\n```bash\nCUDA_VISIBLE_DEVICES=1 python train_geo.py \\                                                                   \n    --model_name 3frames \\\n    --data_path DATA_PATH \\\n    --val_path ./data \\\n    --segment_path ./data/segments \\\n    --log_dir ./logs \\\n    --lambda_planar_reg 0.05 \\\n    --batch_size 12 \\\n    --scales 0 \\\n    --frame_ids_to_train 0 -1 1\n```\n\n### 5-frames\nUsing the pretrained model from 3-frames setting gives better results.\n```bash\nCUDA_VISIBLE_DEVICES=1 python train_geo.py \\                                                                   \n    --model_name 5frames \\\n    --data_path DATA_PATH \\\n    --val_path ./data \\\n    --segment_path ./data/segments \\\n    --log_dir ./logs \\\n    --lambda_planar_reg 0.05 \\\n    --batch_size 12 \\\n    --scales 0 \\\n    --load_weights_folder FOLDER_OF_3FRAMES_MODEL \\\n    --frame_ids_to_train 0 -2 -1 1 2\n```\n\n## Acknowledgements\nThis project is built upon [Monodepth2](https://github.com/nianticlabs/monodepth2). We thank authors of Monodepth2 for their great work and repo.\n\n## License\nTBD\n\n## Citation\nPlease cite our paper for any purpose of usage.\n```\n@inproceedings{IndoorSfMLearner,\n  author    = {Zehao Yu and Lei Jin and Shenghua Gao},\n  title     = {P$^{2}$Net: Patch-match and Plane-regularization for Unsupervised Indoor Depth Estimation},\n  booktitle = {ECCV},\n  year      = {2020}\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvip-lab%2Findoor-sfmlearner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsvip-lab%2Findoor-sfmlearner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvip-lab%2Findoor-sfmlearner/lists"}