{"id":22069259,"url":"https://github.com/cskyl/SAM_WSSS","last_synced_at":"2025-07-24T07:32:46.743Z","repository":{"id":164022729,"uuid":"637213828","full_name":"cskyl/SAM_WSSS","owner":"cskyl","description":"SAM Enhance Mask Quality for WSSS: This repository provides tools for generating, evaluating, and visualizing enhanced pseudo masks for Weakly Supervised Semantic Segmentation (WSSS) using the Segment Anything Model (SAM). ","archived":false,"fork":false,"pushed_at":"2023-10-09T15:43:30.000Z","size":3678,"stargazers_count":31,"open_issues_count":6,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2023-10-09T17:09:18.716Z","etag":null,"topics":["pascal-voc","sam","weakly-supervised-learning","wsss"],"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/cskyl.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}},"created_at":"2023-05-06T21:23:44.000Z","updated_at":"2023-10-09T13:39:06.000Z","dependencies_parsed_at":"2023-12-12T09:15:10.458Z","dependency_job_id":null,"html_url":"https://github.com/cskyl/SAM_WSSS","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cskyl%2FSAM_WSSS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cskyl%2FSAM_WSSS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cskyl%2FSAM_WSSS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cskyl%2FSAM_WSSS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cskyl","download_url":"https://codeload.github.com/cskyl/SAM_WSSS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227421456,"owners_count":17775011,"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":["pascal-voc","sam","weakly-supervised-learning","wsss"],"created_at":"2024-11-30T20:04:48.966Z","updated_at":"2024-11-30T20:07:54.392Z","avatar_url":"https://github.com/cskyl.png","language":"Python","funding_links":[],"categories":["Paper List"],"sub_categories":["Follow-up Papers"],"readme":"# SAM_WSSS\nCode repository for our paper \"[Segment Anything Model (SAM) Enhanced Pseudo\nLabels for Weakly Supervised Semantic Segmentation](https://arxiv.org/abs/2305.05803)\"\nThis is a Python script for our proposed framework.\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your local machine.\n\n### Prerequisites\n\n- Python 3.6 or higher\n\n### Installation\n\nClone the repository:\n\n```bash\ngit https://github.com/cskyl/SAM_WSSS.git\ncd SAM_WSSS\n```\n\n### Running mask enhancement\n\nYou can specify the locations of your pseudo labels and SAM masks folders by modifying the pseudo_path and sam_path respectively. Use the command below, replacing your_pseudo_labels and your_SAM_masks with the corresponding paths on your system:\n\n```\npython main.py --pseudo_path \u003cyour_pseudo_labels\u003e --sam_path \u003cyour_SAM_masks\u003e \n```\n\nThis will use our default merging algorithm, and the result will be stored in \n```\nSAM_WSSS/processed_masks\n```\n\n### Evaluation and Visualization\n\nTo evaluate the quality of the pseudo masks and enhanced masks, you can use the following command. Please note that the current version of our code supports evaluation for object classes from the PASCAL VOC 2012 dataset.\n```\npython main.py --mode eval --pseudo_path \u003cyour_pseudo_labels\u003e --sam_path \u003cyour_SAM_masks\u003e --gt_dir \u003cVOCdevkit/VOC2012/JPEGImages\u003e\n```\n\nThis script will generate evaluation statistics for each image sample, which will be saved in a .csv file in the following directory:\n```\nSAM_WSSS/eval\n```\n\nFor visualization purposes, you can use the command below. You have the option to visualize specific samples by using vis_sample. Alternatively, you can use vis_best or vis_worst to visualize the top 10 samples that showed the most improvement or the least improvement, respectively, in delta mIoU after enhancement.\n```\npython main.py --mode vis --pseudo_path \u003cyour_pseudo_labels\u003e --sam_path \u003cyour_SAM_masks\u003e --gt_dir \u003cVOCdevkit/VOC2012/JPEGImages\u003e --images_path \u003cVOCdevkit/VOC2012/JPEGImages\u003e\n```\nThis will generat the visualization in\n```\nSAM_WSSS/visualizations\n```\n\n## Customizing the Merging Algorithm\n\nIf you wish to implement your own merging algorithm, you can modify the `merge` function located in the following script:\n```\nSAM_WSSS/merge/merge_customize\n```\nTo run your custom algorithm, use the following command:\n```\npython main.py --pseudo_path \u003cyour_pseudo_labels\u003e --sam_path \u003cyour_SAM_masks\u003e --method 'merge_customize'\n```\n\nBy changing the --mode argument to 'all', you can run the entire pipeline, which includes merging, evaluation, and visualization. \n\n\nIf you are using our code, please consider citing our paper.\n\n```\n@misc{chen2023segment,\n      title={Segment Anything Model (SAM) Enhanced Pseudo Labels for Weakly Supervised Semantic Segmentation}, \n      author={Tianle Chen and Zheda Mai and Ruiwen Li and Wei-lun Chao},\n      year={2023},\n      eprint={2305.05803},\n      archivePrefix={arXiv},\n      primaryClass={cs.CV}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcskyl%2FSAM_WSSS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcskyl%2FSAM_WSSS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcskyl%2FSAM_WSSS/lists"}