Authors:
Yiming Zhao, Tao Zhou, Yunqi Gu, Yi Zhou, Yizhe Zhang, Ye Wu, and Huazhu Fu.
- This repository provides code for "WeakPolyp-SAM: Segment Anything Model-driven Weakly-supervised Polyp Segmentation"
Figure 1: Overview of the proposed framework.
Figure 2: Visualization results of different methods on the polyp segmentation.
-
Installation
To set up the environment and install dependencies, run:
pip install -r requirements.txt
-
Data:
- downloading Polyp dataset, which can be found from GoogleDrive, run:
unrar x PolypData.rar
- downloading SAM weights and move it into
./checkpoints/sam_vit_b_01ec64.pth, which can be found from GitHub.
-
Preprocessing:
- Download PolypData and put them into
./datafolder with the following structure:|-- data | |-- TrainDB | |-- image | |-- scribble | |-- TestDB | |-- CVC-300 | |-- CVC-ClinicDB | |-- CVC-ColonDB | |-- ETIS-LaribPolypDB | |-- Kvasir - Download the pre-trained model.
- Download PolypData and put them into
-
Training:
- To train our model, run:
python train_semi_SAM.py
-
Testing:
- To test our model, just run:
python test.py
The source code and dataset are free for research and education use only. Any comercial use should get formal permission first.