{"id":20065505,"url":"https://github.com/cvi-szu/ccam","last_synced_at":"2025-03-17T15:12:47.683Z","repository":{"id":37703369,"uuid":"473867635","full_name":"CVI-SZU/CCAM","owner":"CVI-SZU","description":"[CVPR 2022] C2AM: Contrastive learning of Class-agnostic Activation Map for Weakly Supervised Object Localization and Semantic Segmentation","archived":false,"fork":false,"pushed_at":"2024-05-04T01:57:18.000Z","size":5293,"stargazers_count":190,"open_issues_count":12,"forks_count":25,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-02T13:08:47.273Z","etag":null,"topics":["contrastive-learning","image-segmentation","weakly-supervised-learning","weakly-supervised-segmentation"],"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/CVI-SZU.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-25T04:26:18.000Z","updated_at":"2025-01-02T06:51:31.000Z","dependencies_parsed_at":"2024-05-04T02:44:19.739Z","dependency_job_id":null,"html_url":"https://github.com/CVI-SZU/CCAM","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/CVI-SZU%2FCCAM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CVI-SZU%2FCCAM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CVI-SZU%2FCCAM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CVI-SZU%2FCCAM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CVI-SZU","download_url":"https://codeload.github.com/CVI-SZU/CCAM/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244056425,"owners_count":20390719,"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":["contrastive-learning","image-segmentation","weakly-supervised-learning","weakly-supervised-segmentation"],"created_at":"2024-11-13T13:50:58.718Z","updated_at":"2025-03-17T15:12:47.604Z","avatar_url":"https://github.com/CVI-SZU.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C2AM (Unsupervised)\n## Update (2022-12-12)\nWe update the evaluation results using ResNet50 as both localization and classfication backbone. Table is also updated in our [Arxiv paper](https://arxiv.org/abs/2203.13505).\n\n| Method    | Loc Back. | Cls Back.  | CUB (top1/top5 loc)  | CUB (GT-Known)  | ImageNet (top1/top5 loc) | ImageNet (GT-Known) |\n|:---------:|:-----------:|:----:|:----:|:----:|:----:|:----:|\n| ORNet     |   VGG16         | VGG16 |   67.74 / 80.77 |  86.20 | 52.05 / 63.94 | 68.27 |\n| PSOL      |  ResNet50       | ResNet50 |  70.68 / 86.64    |   90.00 | 53.98 / 63.08 | 65.44 |\n| C2AM (supervised initialization)      |  ResNet50       | ResNet50 |  76.36 / 89.15   |  93.40 | 54.41 / 64.77 | 67.80 |\n| C2AM (unsupervised initialization)      |  ResNet50       | ResNet50 |  74.76 / 87.37    |   91.54 | 54.65 / 65.05 | 68.07 |\n\n\nCode repository for our\npaper \"[C2AM: Contrastive learning of Class-agnostic Activation Map for Weakly Supervised Object Localization and Semantic Segmentation](https://arxiv.org/abs/2203.13505)\"\nin **CVPR 2022**.\n\n:heart_eyes: Code for our paper \"[CLIMS: Cross Language Image Matching for Weakly Supervised Semantic Segmentation](https://arxiv.org/abs/2203.02668)\" in **CVPR 2022** is also available [here](https://openaccess.thecvf.com/content/CVPR2022/html/Xie_CLIMS_Cross_Language_Image_Matching_for_Weakly_Supervised_Semantic_Segmentation_CVPR_2022_paper.html).\n\n\n![](images/CCAM_Network.png)\n\nThe repository includes full training, evaluation, and visualization codes\non [CUB-200-2011](http://www.vision.caltech.edu/visipedia/CUB-200.html), [ILSVRC2012](https://image-net.org/challenges/LSVRC/2012/), and [PASCAL VOC2012](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/) datasets.\n\n**We provide the extracted class-agnostic bounding boxes (on CUB-200-2011 and ILSVRC2012) and background cues (on PASCAL VOC12) from [here](https://drive.google.com/drive/folders/1erzARKq9g02-3pUGhY6-hyGzD-hoty5b)**.\n\n![](images/CCAM_Background.png)\n\n\n\n## Dependencies\n\n* Python 3\n* PyTorch 1.7.1\n* OpenCV-Python\n* Numpy\n* Scipy\n* MatplotLib\n* Yaml\n* Easydict\n\n## Dataset\n\n### CUB-200-2011\n\nYou will need to download the images (JPEG format) in CUB-200-2011 dataset\nfrom [here](http://www.vision.caltech.edu/visipedia/CUB-200.html). Make sure your ```data/CUB_200_2011``` folder is structured as\nfollows:\n\n```\n├── CUB_200_2011/\n|   ├── images\n|   ├── images.txt\n|   ├── bounding_boxes.txt\n|   ...\n|   └── train_test_split.txt\n```\n\nYou will need to download the images (JPEG format) in ILSVRC2012 dataset from [here](https://image-net.org/challenges/LSVRC/2012/).\nMake sure your ```data/ILSVRC2012``` folder is structured as follows:\n\n### ILSVRC2012\n\n```\n├── ILSVRC2012/ \n|   ├── train\n|   ├── val\n|   ├── val_boxes\n|   |   ├——val\n|   |   |   ├—— ILSVRC2012_val_00050000.xml\n|   |   |   ├—— ...\n|   ├── train.txt\n|   └── val.txt\n```\n\n### PASCAL VOC2012\n\nYou will need to download the images (JPEG format) in PASCAL VOC2012 dataset from [here](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/).\nMake sure your ```data/VOC2012``` folder is structured as follows:\n\n```\n├── VOC2012/\n|   ├── Annotations\n|   ├── ImageSets\n|   ├── SegmentationClass\n|   ├── SegmentationClassAug\n|   └── SegmentationObject\n```\n\n## For WSOL task\n\nplease refer to the directory of './WSOL'\n\n```\ncd WSOL\n```\n\n## For WSSS task\n\nplease refer to the directory of './WSSS'\n\n```\ncd WSSS\n```\n\n### Comparison with CAM\n\n![](images/CCAM_Heatmap.png)\n\n## CUSTOM DATASET\n\nAs CCAM is an unsupervised method, it can be applied to various scenarios, like ReID, Saliency detection, or skin lesion detection. We provide an example to apply CCAM on your custom dataset like 'Market-1501'.\n\n```\ncd CUSTOM\n```\n\n\n\n## Reference\n\nIf you are using our code, please consider citing our paper.\n\n```\n@InProceedings{Xie_2022_CVPR,\n    author    = {Xie, Jinheng and Xiang, Jianfeng and Chen, Junliang and Hou, Xianxu and Zhao, Xiaodong and Shen, Linlin},\n    title     = {C2AM: Contrastive Learning of Class-Agnostic Activation Map for Weakly Supervised Object Localization and Semantic Segmentation},\n    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},\n    month     = {June},\n    year      = {2022},\n    pages     = {989-998}\n}\n@article{xie2022contrastive,\n  title={Contrastive learning of Class-agnostic Activation Map for Weakly Supervised Object Localization and Semantic Segmentation},\n  author={Xie, Jinheng and Xiang, Jianfeng and Chen, Junliang and Hou, Xianxu and Zhao, Xiaodong and Shen, Linlin},\n  journal={arXiv preprint arXiv:2203.13505},\n  year={2022}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvi-szu%2Fccam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcvi-szu%2Fccam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvi-szu%2Fccam/lists"}