PyTorch implementation of An Alternative to WSSS? An Empirical Study of the Segment Anything Model (SAM) on Weakly-Supervised Semantic Segmentation Problems
This is an inference-only method, no training is needed.
You should set the environment variable manually as follows if you want to build a local GPU environment for Grounded-SAM:
export AM_I_DOCKER=False
export BUILD_WITH_CUDA=True
export CUDA_HOME=/path/to/cuda-11.3/
Install Segment Anything:
python -m pip install -e segment_anything
Install Grounding DINO:
python -m pip install -e GroundingDINO
cd wsss_sam
wget https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth
wget https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha/groundingdino_swint_ogc.pth
Prepare pascal and COCO data.
Set the data path accordingly and run:
bash run_coco.sh
bash run_pascal.sh
@misc{sun2023alternative,
title={An Alternative to WSSS? An Empirical Study of the Segment Anything Model (SAM) on Weakly-Supervised Semantic Segmentation Problems},
author={Weixuan Sun and Zheyuan Liu and Yanhao Zhang and Yiran Zhong and Nick Barnes},
year={2023},
eprint={2305.01586},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
This work is heavily built upon the codebase provided by Grounded-Segment-Anything, Thanks for their great code.