{"id":18682527,"url":"https://github.com/postech-cvlab/instaorder","last_synced_at":"2025-04-12T04:21:47.358Z","repository":{"id":109960682,"uuid":"474578599","full_name":"POSTECH-CVLab/InstaOrder","owner":"POSTECH-CVLab","description":"Instance-wise Occlusion and Depth Orders in Natural Scenes (CVPR 2022)","archived":false,"fork":false,"pushed_at":"2022-04-06T02:56:30.000Z","size":4001,"stargazers_count":38,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T23:51:21.050Z","etag":null,"topics":["computer-vision"],"latest_commit_sha":null,"homepage":"https://github.com/POSTECH-CVLab/InstaOrder","language":"Jupyter Notebook","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/POSTECH-CVLab.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-27T08:30:43.000Z","updated_at":"2025-01-17T14:48:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"fa0d7004-1644-420c-819f-caca18673443","html_url":"https://github.com/POSTECH-CVLab/InstaOrder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/POSTECH-CVLab%2FInstaOrder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/POSTECH-CVLab%2FInstaOrder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/POSTECH-CVLab%2FInstaOrder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/POSTECH-CVLab%2FInstaOrder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/POSTECH-CVLab","download_url":"https://codeload.github.com/POSTECH-CVLab/InstaOrder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248514444,"owners_count":21116963,"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"],"created_at":"2024-11-07T10:12:14.577Z","updated_at":"2025-04-12T04:21:47.334Z","avatar_url":"https://github.com/POSTECH-CVLab.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Instance-wise Occlusion and Depth Orders in Natural Scenes \nOfficial source code. Appears at **CVPR 2022**\n\nThis repository provides a new dataset, named InstaOrder, that can be used to understand the geometrical relationships of instances in an image. The dataset consists of 2.9M annotations of geometric orderings for class-labeled instances in 101K natural scenes. The scenes were annotated by 3,659 crowd-workers regarding (1) **occlusion order** that identifies occluder/occludee and (2) **depth order** that describes ordinal relations that consider relative distance from the camera. This repository also introduce a geometric order prediction network called **InstaOrderNet**, which is superior to state-of-the-art approaches.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"demo_images/dataset.png\" height=\"450\"\u003e\n\u003c/p\u003e\n  \n## Installation\nThis code has been developed under Anaconda(Python 3.6), Pytorch 1.7.1, torchvision 0.8.2 and CUDA 10.1. Please install following environments:\n\n  \n```bash\n# build conda environment\nconda create --name order python=3.6\nconda activate order\n\n# install requirements\npip install -r requirements.txt\n\n# install COCO API\npip install 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'\n```\n\n## Visualization\nCheck `InstaOrder_vis.ipynb` to visualize InstaOrder dataset including instance masks, occlusion order, and depth order.\n\n## Training\nThe `experiments` folder contains train and test scripts of experiments demonstrated in the paper. \n\nTo train {MODEL} with {DATASET},\n1. Download ```{DATASET}``` following [this](#Datasets).\n2. Set ```${base_dir}``` correctly in ```experiments/{DATASET}/{MODEL}/config.yaml```\n3. (Optional) To train InstaDepthNet, download MiDaS-v2.1 [model-f6b98070.pt](https://github.com/intel-isl/MiDaS/releases/download/v2_1/model-f6b98070.pt) under ```${base_dir}/data/out/InstaOrder_ckpt```\n4. Run the script file as follow:\n    ```bash\n    sh experiments/{DATASET}/{MODEL}/train.sh\n\n    # Example of training InstaOrderNet^o (Table3 in the main paper) from the scratch\n    sh experiments/InstaOrder/InstaOrderNet_o/train.sh\n    ```\n\n\n\n## Inference\n1. Download pretrained models [InstaOrder_ckpt.zip](https://drive.google.com/file/d/1_GEmCmofLSkJZnidfp4vsQb2Nqq5aqBU/view?usp=sharing) (3.5G) and unzip files following the below structure. Pretrained models are named by ```{DATASET}_{MODEL}.pth.tar```\n\n    ```\n    ${base_dir}\n    |--data\n    |    |--out\n    |    |    |--InstaOrder_ckpt\n    |    |    |    |--COCOA_InstaOrderNet_o.pth.tar\n    |    |    |    |--COCOA_OrderNet.pth.tar\n    |    |    |    |--COCOA_pcnet_m.pth.tar\n    |    |    |    |--InstaOrder_InstaDepthNet_d.pth.tar\n    |    |    |    |--InstaOrder_InstaDepthNet_od.pth.tar\n    |    |    |    |--InstaOrder_InstaOrderNet_d.pth.tar\n    |    |    |    |--InstaOrder_InstaOrderNet_o.pth.tar\n    |    |    |    |--InstaOrder_InstaOrderNet_od.pth.tar\n    |    |    |    |--InstaOrder_OrderNet.pth.tar\n    |    |    |    |--InstaOrder_OrderNet_ext.pth.tar  \n    |    |    |    |--InstaOrder_pcnet_m.pth.tar\n    |    |    |    |--KINS_InstaOrderNet_o.pth.tar\n    |    |    |    |--KINS_OrderNet.pth.tar\n    |    |    |    |--KINS_pcnet_m.pth.tar\n    ```\n2. (Optional) To test InstaDepthNet, download MiDaS-v2.1 [model-f6b98070.pt](https://github.com/intel-isl/MiDaS/releases/download/v2_1/model-f6b98070.pt) under ```${base_dir}/data/out/InstaOrder_ckpt```\n\n3. Set ```${base_dir}``` correctly in ```experiments/{DATASET}/{MODEL}/config.yaml```\n\n\n3. To test {MODEL} with {DATASET}, run the script file as follow:\n     ```bash\n    sh experiments/{DATASET}/{MODEL}/test.sh\n\n    # Example of reproducing the accuracy of InstaOrderNet^o (Table3 in the main paper)\n    sh experiments/InstaOrder/InstaOrderNet_o/test.sh\n\n   ```\n\n\n\n\n\n## Datasets\n\n### InstaOrder dataset\nTo use InstaOrder, download files following the below structure\n  - [InstaOrder annotations (ours)](https://drive.google.com/file/d/1n4NxDBkxhnRNSKuB8TDGGFcSD83Zknlj/view?usp=sharing)\n  - [COCO 2017 annotations](https://cocodataset.org/#download)\n  - [COCO 2017 train, val images](https://cocodataset.org/#download)\n    \n  ```\n  ${base_dir}\n  |--data\n  |    |--COCO\n  |    |    |--train2017/\n  |    |    |--val2017/\n  |    |    |--annotations/\n  |    |    |    |--instances_train2017.json\n  |    |    |    |--instances_val2017.json\n  |    |    |    |--InstaOrder_train2017.json\n  |    |    |    |--InstaOrder_val2017.json    \n  ```\n\n\n### COCOA dataset\nTo use COCOA, download files following the below structure\n  - [COCOA annotations](https://github.com/Wakeupbuddy/amodalAPI)\n  - [COCO 2014 train, val images](https://cocodataset.org/#download)\n\n  ```\n  ${base_dir}\n  |--data\n  |    |--COCO\n  |    |    |--train2014/\n  |    |    |--val2014/\n  |    |    |--annotations/\n  |    |    |    |--COCO_amodal_train2014.json \n  |    |    |    |--COCO_amodal_val2014.json\n  |    |    |    |--COCO_amodal_val2014.json\n\n  ```\n\n### KINS dataset\nTo use KINS, download files following the below structure\n- [KINS dataset](https://github.com/qqlu/Amodal-Instance-Segmentation-through-KINS-Dataset)\n\n```\n${base_dir}\n|--data\n|    |--KINS\n|    |    |--training/\n|    |    |--testing/\n|    |    |--instances_val.json\n|    |    |--instances_train.json\n  \n```\n\n\n### DIW dataset\nTo use DIW, download files following the below structure\n- [DIW Dataset](http://www-personal.umich.edu/~wfchen/depth-in-the-wild/)\n\n```\n${base_dir}\n|--data\n|    |--DIW\n|    |    |--DIW_test/\n|    |    |--DIW_Annotations\n|    |    |    |--DIW_test.csv   \n\n```\n\n\n\n## Citing InstaOrder\n\nIf you find this code/data useful in your research then please cite our [paper](https://arxiv.org/abs/2111.14562):\n```\n@inproceedings{lee2022instaorder,\n  title={{Instance-wise Occlusion and Depth Orders in Natural Scenes}},\n  author={Hyunmin Lee and Jaesik Park},\n  booktitle={Proceedings of the {IEEE} Conference on Computer Vision and Pattern Recognition},\n  year={2022}\n}\n```\n\n  \n## Acknowledgement\nWe have reffered to and borrowed the implementations from [Xiaohang Zhan](https://github.com/XiaohangZhan/deocclusion/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostech-cvlab%2Finstaorder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpostech-cvlab%2Finstaorder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostech-cvlab%2Finstaorder/lists"}