This is the implementation of the auxiliary support generator in paper "DifFSS: Diffusion Model for Few-Shot Semantic Segmentation".
For more information, Please refer to the the paper on [arXiv].
conda env create -f environment.yaml
conda activate control
All models and detectors can be downloaded from Hugging Face page. Make sure that SD models are put in "ControlNet/models" and detectors are put in "ControlNet/annotator/ckpts". Make sure that you download all necessary pretrained weights and detector models from that Hugging Face page.
For DifFSS, we utilized the seg, scribble, hed model of ControlNet.
Please download the following datasets:
-
PASCAL-5i: PASCAL VOC 2012 and SBD
-
COCO-20i: COCO 2014.
-
FSS-1000: FSS-1000.
python FSSpregenerate.py --st 0 --end -1 --imgdir /data/user6/coco/ --maskdir /data/user6/coco/annotations/ --dstdir /data/user6/justtest/ --list ./list/coco_all.txt --dataset coco --guidance seg --save_control 0
Please refer to the source code for the functions of arguments.
The DifFSS method can be easily applied to existing FSS models, please refer to one of our implementations on BAM here.