{"id":20065499,"url":"https://github.com/cvi-szu/qa-clims","last_synced_at":"2025-05-05T18:31:46.972Z","repository":{"id":217851130,"uuid":"744952828","full_name":"CVI-SZU/QA-CLIMS","owner":"CVI-SZU","description":"[ACM MM 2023] QA-CLIMS: Question-Answer Cross Language Image Matching for Weakly Supervised Semantic Segmentation","archived":false,"fork":false,"pushed_at":"2024-06-14T12:48:24.000Z","size":9655,"stargazers_count":10,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-14T14:09:54.314Z","etag":null,"topics":["semantic-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":"2024-01-18T10:44:07.000Z","updated_at":"2024-06-14T12:48:28.000Z","dependencies_parsed_at":"2024-06-14T14:22:13.618Z","dependency_job_id":null,"html_url":"https://github.com/CVI-SZU/QA-CLIMS","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"89421df9c2b9fed75565f606ef40b85142485c73"},"previous_names":["cvi-szu/qa-clims"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CVI-SZU%2FQA-CLIMS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CVI-SZU%2FQA-CLIMS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CVI-SZU%2FQA-CLIMS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CVI-SZU%2FQA-CLIMS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CVI-SZU","download_url":"https://codeload.github.com/CVI-SZU/QA-CLIMS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224460491,"owners_count":17315109,"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":["semantic-segmentation","weakly-supervised-learning","weakly-supervised-segmentation"],"created_at":"2024-11-13T13:50:57.646Z","updated_at":"2024-11-13T13:50:58.287Z","avatar_url":"https://github.com/CVI-SZU.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [MM'23] QA-CLIMS\n\nThis is the official PyTorch implementation of our paper:\n\n\u003e **QA-CLIMS: Question-Answer Cross Language Image Matching for Weakly Supervised Semantic Segmentation** \u003cbr\u003e\n\u003e [Songhe Deng](https://github.com/Tiiiktak), [Wei Zhuo](), [Jinheng Xie](https://github.com/Sierkinhane), [Linlin Shen](https://scholar.google.com/citations?user=AZ_y9HgAAAAJ) \u003cbr\u003e\n\u003e Computer Vision Institute, Shenzhen University\u003cbr\u003e\n\u003e ACM International Conference on Multimedia, 2023 \u003cbr\u003e\n\u003e [[Paper]](https://dl.acm.org/doi/10.1145/3581783.3612148) [[arXiv]](https://arxiv.org/abs/2401.09883)\n\n\u003cimg src=\"source/method_fig.png\" width=\"800\"/\u003e\n\n## Environment\n\n- Python 3.7\n- PyTorch 1.7.1\n- torchvision 0.8.2\n\n```shell\npip install -r requirements.txt\n```\n\n## PASCAL VOC2012\n\nYou can find the following files at [here](https://drive.google.com/drive/folders/1U79Lmp-ufajPCUG7jAVyk924f9YmQSsA?usp=drive_link).\n\n| File                       | filename                                                                       |\n|:---------------------------|:-------------------------------------------------------------------------------|\n| FG \u0026 BG VQA results        | `voc_vqa_fg_blip.npy` \u003cbr\u003e `voc_vqa_bg_blip.npy`                               | \n| FG \u0026 BG VQA text features  | `voc_vqa_fg_blip_ViT-L-14_cache.npy` \u003cbr\u003e `voc_vqa_bg_blip_ViT-L-14_cache.npy` |\n| pre-trained baseline model | `res50_cam.pth`                                                                |\n| QA-CLIMS model             | `res50_qa_clims.pth`                                                           |\n\n\n### 1. Prepare VQA result features\n\nYou can download the VQA text features `voc_vqa_fg_blip_ViT-L-14_cache.npy` and `voc_vqa_bg_blip_ViT-L-14_cache.npy` above \nand put its in `vqa/`.\n\n\u003cdetails\u003e\n\u003csummary\u003eOr, you can generate it by yourself:\u003c/summary\u003e\n\nTo generate VQA results, please follow [third_party/README](third_party/README.md#BLIP).\n\nAfter that, run following command to generate VQA text features:\n\n```shell\npython gen_text_feats_cache.py voc \\\n    --vqa_fg_file vqa/voc_vqa_fg_blip.npy \\\n    --vqa_fg_cache_file vqa/voc_vqa_fg_blip_ViT-L-14_cache.npy \\\n    --vqa_bg_file vqa/voc_vqa_bg_blip.npy \\\n    --vqa_bg_cache_file vqa/voc_vqa_bg_blip_ViT-L-14_cache.npy \\\n    --clip ViT-L/14\n```\n\n\u003c/details\u003e\n\n\n### 2. Train QA-CLIMS and generate initial CAMs\n\nPlease download the pre-trained baseline model `res50_cam.pth` above and put it at `cam-baseline-voc12/res50_cam.pth`.\n\n```shell\nbash run_voc12_qa_clims.sh\n```\n\n### 3. Train IRNet and generate pseudo semantic masks\n\n```shell\nbash run_voc12_sem_seg.sh\n```\n\n### 4.Train DeepLab using pseudo semantic masks. \n\nPlease follow [deeplab-pytorch](https://github.com/kazuto1011/deeplab-pytorch) or [CLIMS](https://github.com/CVI-SZU/CLIMS/tree/master/segmentation/deeplabv2).\n\n## MS COCO2014\n\nYou can find the following files at [here](https://drive.google.com/drive/folders/1U79Lmp-ufajPCUG7jAVyk924f9YmQSsA?usp=drive_link).\n\n| File                       | filename                                                                         |\n|:---------------------------|:---------------------------------------------------------------------------------|\n| FG \u0026 BG VQA results        | `coco_vqa_fg_blip.npy` \u003cbr\u003e `coco_vqa_bg_blip.npy`                               | \n| FG \u0026 BG VQA text features  | `coco_vqa_fg_blip_ViT-L-14_cache.npy` \u003cbr\u003e `coco_vqa_bg_blip_ViT-L-14_cache.npy` |\n| pre-trained baseline model | `res50_cam.pth`                                                                  |\n| QA-CLIMS model             | `res50_qa_clims.pth`                                                             |\n\n\nPlease place the downloaded `coco_vqa_fg_blip_ViT-L-14_cache.npy` and `coco_vqa_bg_blip_ViT-L-14_cache.npy` \nin `vqa/`, and `res50_cam.pth` in `cam-baseline-coco14/`.\n\nThen, running the following command:\n\n```shell\nbash run_coco14_qa_clims.sh\nbash run_coco14_sem_seg.sh\n```\n\n\n## Citation\n\nIf you find this code useful for your research, please consider cite our paper:\n\n```\n@inproceedings{deng2023qa-clims,\n  title={QA-CLIMS: Question-Answer Cross Language Image Matching for Weakly Supervised Semantic Segmentation},\n  author={Deng, Songhe and Zhuo, Wei and Xie, Jinheng and Shen, Linlin},\n  booktitle={Proceedings of the 31st ACM International Conference on Multimedia},\n  pages={5572--5583},\n  year={2023}\n}\n```\n\n\n---\n\nThis repository was highly based on [CLIMS](https://github.com/CVI-SZU/CLIMS) and [IRNet](https://github.com/jiwoon-ahn/irn), thanks for their great works!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvi-szu%2Fqa-clims","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcvi-szu%2Fqa-clims","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvi-szu%2Fqa-clims/lists"}