The official implementation of our AAAI 2025 publication SPT.
conda create -n spt python=3.8
conda activate spt
conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.3 -c pytorch
pip install matplotlib
pip install opencv-python
pip install timm
pip install scikit-image
pip install imgaug
pip install pandas
Please download the dataset using this link and extract the archive directly into the repository root.
-
Pre-trained SAM checkpoints. Download here
pretrained_checkpoint/ ├── vit_b.pth ├── vit_h.pth └── vit_l.pth
-
SPT checkpoints. Download here
spt_ckpt/ ├── spt_vit_b.pth ├── spt_vit_h.pth └── spt_vit_l.pth
To launch inference in one step, simply run:
sh main.sh
If you find our work helpful for your research, please consider citing:
@inproceedings{yang2025promptable,
title={Promptable anomaly segmentation with sam through self-perception tuning},
author={Yang, Hui-Yue and Chen, Hui and Wang, Ao and Chen, Kai and Lin, Zijia and Tang, Yongliang and Gao, Pengcheng and Quan, Yuming and Han, Jungong and Ding, Guiguang},
booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
volume={39},
number={12},
pages={13017--13025},
year={2025}
}
This codebase is built upon SAM, LoRA, HQ-SAM, Grounded SAM and MobileSAM
Thanks for their public code and released models.