Yilong Yang · Jianxin Tian · Shengchuan Zhang · Liujuan Cao
Key Laboratory of Multimedia Trusted Perception and Efficient Computing, Ministry of Education of China, Xiamen University, Xiamen, China
- [2026/07/26] Paper and code are released.
- Python 3.12 or higher
- PyTorch 2.7 or higher
- Transformers 5.0.0 or higher
- CUDA-compatible GPU with CUDA 12.6 or higher
- Clone the repository and install the package:
git clone https://github.com/ynulonger/GFR-SAM.git
cd sam3/sam3
pip install -e .-
Prepare checkpoints:
GFR-SAM relies on frozen DINOv3 and SAM3 backbones. Please download the pretrained weights from the official repository:
👉 https://huggingface.co/facebook/sam3
👉 https://huggingface.co/facebook/dinov3-vitb16-pretrain-lvd1689mPlace the weights and configuration files of the backbone under the hf-sam3 and hf-dinov3 folders.
-
Dataset preparation:
Download the R2C7K dataset and replace the path of the dataset in the ref-sam3.ipynb.
-
Test and Visualisation:
Run the ref-sam3.ipynb to perform in-context segmentation and visualise both intermediate and final output masks.
If you find this work useful in your research, please cite:
@inproceedings{cuttano2026insid3,
title = {GFR-SAM: Training-Free Referring Camouflaged Object Segmentation via Cross-Image Prompting},
author = {Yilong Yang, Jianxin Tian, Shengchuan Zhang, Liujuan Cao},
booktitle = {34th ACM International Conference on Multimedia (ACM MM)},
year = {2026}
}We gratefully acknowledge the contributions of the following open-source projects:
