/cat-sam

The official implementation of "CAT-SAM: Conditional Tuning Network for Few-Shot Adaptation of Segmentation Anything Model".

Primary LanguagePython

CAT-SAM: Conditional Tuning Network for Few-Shot Adaptation of Segmentation Anything Model

The official implementation of "CAT-SAM: Conditional Tuning Network for Few-Shot Adaptation of Segmentation Anything Model".

[arXiv] [Project Page]

Authors: Aoran Xiao*, Weihao Xuan*, Heli Qi, Yun Xing, Ruijie Ren, Xiaoqin Zhang, Shijian Lu

image

Prepare the virtual environment

Please git our project to your local machine and prepare our environment by the following commands:

$: cd cat-sam
$: conda env create -f environment.yaml
$: conda activate cat-sam
(cat-sam) $: python -m pip install -e .

Prepare the datasets

Please refer to the README.md in the dataset-specific folders under ./data to prepare each of them.

Testing

For testing, please run:

$: cd cat-sam
$: pwd
/your_dir/cat-sam
$: conda activate cat-sam
(cat-sam) $: python test.py --dataset <your-target-dataset> --cat_type <your-target-type> --ckpt_path <your-target-ckpt>

For reproducing the results of CAT-SAM models in our paper, please download our checkpoints below to any place in your machine. You can refer to the one you are interested in by --ckpt_path.

Download Checkpoints:

To download the checkpoints, please visit the following Google Drive link:

Google Drive

Note: if you set --dataset whu, please prepare 1 x NVIDIA RTX A5000 (24GB) or the device with more or similar memory.

TODO List

  • Release of test code
  • Release of training code