{"id":13737608,"url":"https://github.com/jinhseo/OD-WSCL","last_synced_at":"2025-05-08T14:33:11.749Z","repository":{"id":46071622,"uuid":"515051280","full_name":"jinhseo/OD-WSCL","owner":"jinhseo","description":"[ECCV2022] Official Pytorch Implementation of Object Discovery via Contrastive Learning for Weakly Supervised Object Detection","archived":false,"fork":false,"pushed_at":"2024-01-16T06:24:15.000Z","size":10691,"stargazers_count":45,"open_issues_count":1,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-15T06:32:09.247Z","etag":null,"topics":["computer-vision","object-detection","weakly-supervised-object-detection"],"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/jinhseo.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-07-18T05:49:33.000Z","updated_at":"2024-08-14T15:35:25.000Z","dependencies_parsed_at":"2024-01-16T08:55:16.502Z","dependency_job_id":null,"html_url":"https://github.com/jinhseo/OD-WSCL","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/jinhseo%2FOD-WSCL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinhseo%2FOD-WSCL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinhseo%2FOD-WSCL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jinhseo%2FOD-WSCL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jinhseo","download_url":"https://codeload.github.com/jinhseo/OD-WSCL/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253085775,"owners_count":21851699,"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","object-detection","weakly-supervised-object-detection"],"created_at":"2024-08-03T03:01:54.861Z","updated_at":"2025-05-08T14:33:07.133Z","avatar_url":"https://github.com/jinhseo.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e Object Discovery via Contrastive Learning for Weakly Supervised Object Detection\u003c/h1\u003e\n\u003c/div\u003e\u003cdiv align=\"center\"\u003e\n  \u003ch3\u003eJinhwan Seo, Wonho Bae, Danica J. Sutherland, Junhyug Noh, and Daijin Kim\u003c/h3\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003cdiv align=\"center\"\u003e\n  \u003ch3\u003e\u003ca href=\"https://github.com/jinhseo/OD-WSCL\"\u003e[Paper]\u003c/a\u003e, \u003ca href=\"https://jinhseo.github.io/research/wsod.html\"\u003e[Project page]\u003c/a\u003e\u003c/h3\u003e\n\u003c/div\u003e\n\u003cbr /\u003e\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./teaser.png\" alt=\"result\" width=\"900\"/\u003e\n\u003c/div\u003e\n\nThe official implementation of ECCV2022 paper: \"Object Discovery via Contrastive Learning for Weakly Supervised Object Detection\"  \n\n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/object-discovery-via-contrastive-learning-for/weakly-supervised-object-detection-on-ms-coco)](https://paperswithcode.com/sota/weakly-supervised-object-detection-on-ms-coco?p=object-discovery-via-contrastive-learning-for)  \n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/object-discovery-via-contrastive-learning-for/weakly-supervised-object-detection-on-ms-coco-1)](https://paperswithcode.com/sota/weakly-supervised-object-detection-on-ms-coco-1?p=object-discovery-via-contrastive-learning-for)  \n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/object-discovery-via-contrastive-learning-for/weakly-supervised-object-detection-on-pascal)](https://paperswithcode.com/sota/weakly-supervised-object-detection-on-pascal?p=object-discovery-via-contrastive-learning-for)  \n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/object-discovery-via-contrastive-learning-for/weakly-supervised-object-detection-on-pascal-1)](https://paperswithcode.com/sota/weakly-supervised-object-detection-on-pascal-1?p=object-discovery-via-contrastive-learning-for)\n## Environment setup:\n\n* [Python 3.7](https://pytorch.org)\n* [CUDA 11.0](https://developer.nvidia.com/cuda-toolkit)\n* [PyTorch 1.7.1](https://pytorch.org)\n```bash\ngit clone https://github.com/jinhseo/OD-WSCL/\ncd OD-WSCL\n\nconda create --name OD-WSCL python=3.7\nconda activate OD-WSCL\n\npip install ninja yacs cython matplotlib tqdm opencv-python tensorboardX pycocotools\nconda install pytorch==1.7.1 torchvision==0.8.2 cudatoolkit=11.0 -c pytorch\n\ngit clone --branch 22.04-dev https://github.com/NVIDIA/apex.git\ncd apex\npip install -v --no-cache-dir --global-option=\"--cpp_ext\" --global-option=\"--cuda_ext\" ./\ncd ../\npython setup.py build develop\n```\n## Dataset:\n* [PASCAL VOC (2007, 2012)](http://host.robots.ox.ac.uk/pascal/VOC/)\n* [MS-COCO (2014, 2017)](https://cocodataset.org/#download)  \n```bash\nmkdir -p datasets/{coco/voc}\n    datasets/\n    ├── voc/\n    │   ├── VOC2007\n    │   │   ├── Annotations/\n    │   │   ├── JPEGImages/\n    │   │   ├── ...\n    │   ├── VOC2012/\n    │   │   ├── ...\n    ├── coco/\n    │   ├── annotations/\n    │   ├── train2014/\n    │   ├── val2014/\n    │   ├── train2017/\n    │   ├── ...\n    ├── ...\n```\n## Proposal:\nDownload .pkl file from [Dropbox](https://www.dropbox.com/sh/sprm4dxg7l22jrg/AAD0kBctuRnCg_rlZHzEBemQa?dl=0)\n```bash\nmkdir proposal\n    proposal/\n    ├── SS/\n    │   ├── voc\n    │   │   ├── SS-voc07_trainval.pkl/\n    │   │   ├── SS-voc07_test.pkl/\n    │   │   ├── ...\n    ├── MCG/\n    │   ├── voc\n    │   │   ├── ...\n    │   ├── coco\n    │   │   ├── MCG-coco_2014_train_boxes.pkl/\n    │   │   ├── ...\n    ├── ...\n```\n## Train:\n```bash\npython -m torch.distributed.launch --nproc_per_node={NO_GPU} tools/train_net.py  \n                                   --config-file \"configs/{config_file}.yaml\"\n                                   OUTPUT_DIR {output_dir}\n                                   nms {nms threshold}\n                                   lmda {lambda value}\n                                   iou {iou threshold}\n                                   temp {temperature}\n```\nExample:\n```bash\npython -m torch.distributed.launch --nproc_per_node=1 tools/train_net.py \n                                   --config-file \"configs/voc07_contra_db_b8_lr0.01_mcg.yaml\" \n                                   OUTPUT_DIR OD-WSCL/output \n                                   nms 0.1 \n                                   lmda 0.03 \n                                   iou 0.5\n                                   temp 0.2\n```\nNote: We trained our model on a single large-memory GPU (\u003cem\u003ee.g.\u003c/em\u003e, A100 40GB) to maintain large mini-batch size for the best performance.  \nThe hyperparameter settings may vary with multiple small GPUs, and results will be provided later.\n## Eval:\n```bash\npython -m torch.distributed.launch --nproc_per_node={NO_GPU} tools/test_net.py\n                                   --config-file \"configs/{config_file}.yaml\" \n                                   TEST.IMS_PER_BATCH 8 \n                                   OUTPUT_DIR {output_dir} \n                                   MODEL.WEIGHT {model_weight}.pth\n```\nExample:\n```bash\npython -m torch.distributed.launch --nproc_per_node=1 tools/test_net.py \n                                   --config-file \"configs/voc07_contra_db_b8_lr0.01_mcg.yaml\" \n                                   TEST.IMS_PER_BATCH 8 \n                                   OUTPUT_DIR OD-WSCL/output \n                                   MODEL.WEIGHT OD-WSCL/output/model_final.pth\n```\n## Citation:\nIf you find helpful our work in your research, please consider cite this: \n```BibTex\n@inproceedings{seo2022object,\n  title={Object discovery via contrastive learning for weakly supervised object detection},\n  author={Seo, Jinhwan and Bae, Wonho and Sutherland, Danica J and Noh, Junhyug and Kim, Daijin},\n  booktitle={European Conference on Computer Vision},\n  pages={312--329},\n  year={2022},\n  organization={Springer}\n}\n```\nWe borrowed the main code from \u003ca href=\"https://github.com/NVlabs/wetectron\"\u003ewetectron\u003c/a\u003e, please consider cite it as well.  \nThank you for sharing your great work!  \n```BibTex\n@inproceedings{ren-cvpr020,\n  title = {Instance-aware, Context-focused, and Memory-efficient Weakly Supervised Object Detection},\n  author = {Zhongzheng Ren and Zhiding Yu and Xiaodong Yang and Ming-Yu Liu and Yong Jae Lee and Alexander G. Schwing and Jan Kautz},\n  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},\n  year = {2020}\n}\n```\n## Acknowledgement:\nThis work was supported by Institute of Information \u0026 communications Technology Planning \u0026 Evaluation(IITP) grant funded by the Korea government(MSIT) (No.2017-0-00897, Development of Object Detection and Recognition for Intelligent Vehicles)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjinhseo%2FOD-WSCL","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjinhseo%2FOD-WSCL","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjinhseo%2FOD-WSCL/lists"}