{"id":13737761,"url":"https://github.com/csuhan/opendet2","last_synced_at":"2025-05-08T15:31:16.519Z","repository":{"id":50288864,"uuid":"472722694","full_name":"csuhan/opendet2","owner":"csuhan","description":"Official code of the paper \"Expanding Low-Density Latent Regions for Open-Set Object Detection\" (CVPR 2022)","archived":false,"fork":false,"pushed_at":"2022-04-07T09:16:11.000Z","size":801,"stargazers_count":96,"open_issues_count":25,"forks_count":11,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-04T03:11:09.575Z","etag":null,"topics":["cvpr2022","detectron2","object-detection","open-set-object-detection"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2203.14911","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/csuhan.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":"2022-03-22T10:46:32.000Z","updated_at":"2024-05-31T02:47:32.000Z","dependencies_parsed_at":"2022-09-19T18:01:55.637Z","dependency_job_id":null,"html_url":"https://github.com/csuhan/opendet2","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csuhan%2Fopendet2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csuhan%2Fopendet2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csuhan%2Fopendet2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csuhan%2Fopendet2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csuhan","download_url":"https://codeload.github.com/csuhan/opendet2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224742330,"owners_count":17362229,"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":["cvpr2022","detectron2","object-detection","open-set-object-detection"],"created_at":"2024-08-03T03:02:00.067Z","updated_at":"2024-11-15T06:30:56.273Z","avatar_url":"https://github.com/csuhan.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"## OpenDet\n\n\u003cimg src=\"./docs/opendet2.png\" width=\"78%\"/\u003e\n\n\u003e **Expanding Low-Density Latent Regions for Open-Set Object Detection (CVPR2022)**\u003cbr\u003e\n\u003e [Jiaming Han](https://csuhan.com), [Yuqiang Ren](https://github.com/Anymake), [Jian Ding](https://dingjiansw101.github.io), [Xingjia Pan](https://scholar.google.com.hk/citations?user=NaSU3eIAAAAJ\u0026hl=zh-CN), Ke Yan, [Gui-Song Xia](http://www.captain-whu.com/xia_En.html).\u003cbr\u003e\n\u003e [arXiv preprint](https://arxiv.org/abs/2203.14911).\n\nOpenDet2: OpenDet is implemented based on [detectron2](https://github.com/facebookresearch/detectron2).\n\n### Setup\n\nThe code is based on [detectron2 v0.5](https://github.com/facebookresearch/detectron2/tree/v0.5). \n\n* **Installation** \n\nHere is a from-scratch setup script.\n\n```\nconda create -n opendet2 python=3.8 -y\nconda activate opendet2\n\nconda install pytorch=1.8.1 torchvision cudatoolkit=10.1 -c pytorch -y\npip install detectron2==0.5 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.8/index.html\ngit clone https://github.com/csuhan/opendet2.git\ncd opendet2\npip install -v -e .\n```\n\n* **Prepare datasets** \n\nPlease follow [datasets/README.md](datasets/README.md) for dataset preparation. Then we generate VOC-COCO datasets.\n\n```\nbash datasets/opendet2_utils/prepare_openset_voc_coco.sh\n# using data splits provided by us.\ncp datasets/voc_coco_ann datasets/voc_coco -rf\n```\n\n### Model Zoo\n\nWe report the results on VOC and VOC-COCO-20, and provide pretrained models. Please refer to the corresponding log file for full results.\n\n* **Faster R-CNN**\n\n| Method  | backbone | mAP\u003csub\u003eK\u0026uarr;\u003c/sub\u003e(VOC) | WI\u003csub\u003e\u0026darr;\u003c/sub\u003e | AOSE\u003csub\u003e\u0026darr;\u003c/sub\u003e | mAP\u003csub\u003eK\u0026uarr;\u003c/sub\u003e | AP\u003csub\u003eU\u0026uarr;\u003c/sub\u003e |   Download   |\n|---------|:--------:|:--------------------------:|:-------------------:|:---------------------:|:---------------------:|:--------------------:|:------------:|\n| FR-CNN  |   R-50   |            80.06           |        19.50        |         16518         |         58.36         |           0          | [config](configs/faster_rcnn_R_50_FPN_3x_baseline.yaml) [model](https://drive.google.com/drive/folders/10uFOLLCK4N8te08-C-olRyDV-cJ-L6lU?usp=sharing) |\n| PROSER  |   R-50   |            79.42           |        20.44        |         14266         |         56.72         |         16.99        | [config](configs/faster_rcnn_R_50_FPN_3x_proser.yaml) [model](https://drive.google.com/drive/folders/1_L85gisyvDtBXPe2UbI49vrd5FoBIOI_?usp=sharing) |\n| ORE     |   R-50   |            79.80           |        18.18        |         12811         |         58.25         |         2.60         | [config]() [model]() |\n| DS      |   R-50   |            79.70           |        16.76        |         13062         |         58.46         |         8.75         | [config](configs/faster_rcnn_R_50_FPN_3x_ds.yaml) [model](https://drive.google.com/drive/folders/1OWDjL29E2H-_lSApXqM2r8PS7ZvUNtiv?usp=sharing) |\n| OpenDet |   R-50   |            80.02           |        12.50        |         10758         |         58.64         |         14.38        | [config](configs/faster_rcnn_R_50_FPN_3x_opendet.yaml) [model](https://drive.google.com/drive/folders/1fzD0iJ6lJrPL4ffByeO9M-udckbYqIxY?usp=sharing) |\n| OpenDet |  Swin-T  |            83.29           |        10.76        |          9149         |         63.42         |         16.35        | [config](configs/faster_rcnn_Swin_T_FPN_3x_opendet.yaml) [model](https://drive.google.com/drive/folders/1j5SkEzeqr0ZnGVVZ4mzXSOvookHfvVvm?usp=sharing) |\n\n* **RetinaNet**\n\n| Method         | mAP\u003csub\u003eK\u0026uarr;\u003c/sub\u003e(VOC) | WI\u003csub\u003e\u0026darr;\u003c/sub\u003e | AOSE\u003csub\u003e\u0026darr;\u003c/sub\u003e | mAP\u003csub\u003eK\u0026uarr;\u003c/sub\u003e | AP\u003csub\u003eU\u0026uarr;\u003c/sub\u003e |     Download     |\n|----------------|:--------------------------:|:-------------------:|:---------------------:|:---------------------:|:--------------------:|:----------------:|\n| RetinaNet      |            79.63           |        14.16        |         36531         |         57.32         |           0          | [config](configs/retinanet_R_50_FPN_3x_baseline.yaml) [model](https://drive.google.com/drive/folders/15fHfyA2HuXp6LfdTMBuHG6ZwtLcgvD-p?usp=sharing) |\n| Open-RetinaNet |            79.64           |        10.74        |         17208         |         57.32         |         10.55        | [config](configs/retinanet_R_50_FPN_3x_opendet.yaml) [model](https://drive.google.com/drive/folders/1uLRZ5bdGaoORWaP2huiyL_WyLicmWT4G?usp=sharing) |\n\n\n**Note**:\n* You can also download the pre-trained models at [github release](https://github.com/csuhan/opendet2/releases) or [BaiduYun](https://pan.baidu.com/s/1I4Pp40pM84aeYTNeGc0kPA) with extracting code ABCD.\n* The above results are reimplemented. Therefore, they are slightly different from our paper.\n* The official code of ORE is at [OWOD](https://github.com/JosephKJ/OWOD). So we do not plan to include ORE in our code. \n\n### Online Demo\n\nTry our online demo at [huggingface space](https://huggingface.co/spaces/csuhan/opendet2).\n\n### Train and Test\n\n* **Testing**\n\nFirst, you need to download pretrained weights in the model zoo, e.g., [OpenDet](https://drive.google.com/drive/folders/10uFOLLCK4N8te08-C-olRyDV-cJ-L6lU?usp=sharing).\n\nThen, run the following command:\n```\npython tools/train_net.py --num-gpus 8 --config-file configs/faster_rcnn_R_50_FPN_3x_opendet.yaml \\\n        --eval-only MODEL.WEIGHTS output/faster_rcnn_R_50_FPN_3x_opendet/model_final.pth\n```\n\n* **Training**\n\nThe training process is the same as detectron2.\n```\npython tools/train_net.py --num-gpus 8 --config-file configs/faster_rcnn_R_50_FPN_3x_opendet.yaml\n```\n\nTo train with the Swin-T backbone, please download [swin_tiny_patch4_window7_224.pth](https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_tiny_patch4_window7_224.pth) and convert it to detectron2's format using [tools/convert_swin_to_d2.py](tools/convert_swin_to_d2.py).\n```\nwget https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_tiny_patch4_window7_224.pth\npython tools/convert_swin_to_d2.py swin_tiny_patch4_window7_224.pth swin_tiny_patch4_window7_224_d2.pth\n```\n\n\n### Citation\n\nIf you find our work useful for your research, please consider citing:\n\n```BibTeX\n@InProceedings{han2022opendet,\n    title     = {Expanding Low-Density Latent Regions for Open-Set Object Detection},\n    author    = {Han, Jiaming and Ren, Yuqiang and Ding, Jian and Pan, Xingjia and Yan, Ke and Xia, Gui-Song},\n    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},\n    year      = {2022}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsuhan%2Fopendet2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsuhan%2Fopendet2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsuhan%2Fopendet2/lists"}