Skip to content

shizenglin/training-free-object-counter

Repository files navigation

Training-free Object Counting with Prompts authored by Zenglin Shi, Ying Sun, Mengmi Zhang. [pdf] [poster] [video]

Installation

1. The code requires python>=3.8, as well as pytorch>=1.7 and torchvision>=0.8.
2. Please follow the instructions here to install both PyTorch and TorchVision dependencies.
3. Installing both PyTorch and TorchVision with CUDA support is strongly recommended.

Getting Started

1. Download the 'vit_b' pre-trained model of SAM and save it to the folder 'pretrain'.
2. Download the FSC-147 and CARPK datasets and save them to the folder 'dataset'
3. Run
python main-fsc147.py --test-split='test' --prompt-type='box' --device='cuda:0'

or

python main-carpk.py --test-split='test' --prompt-type='box' --device='cuda:0'

Success and failure results

Acknowledgment

We express our sincere gratitude to the brilliant minds behind SAM, Personalize-SAM and CLIP-Surgery, as our code builds upon theirs.

Citing

If you use our code in your research, please use the following BibTeX entry.
@inproceedings{Shi2023promptcounting,
  title={Training-free Object Counting with Prompts},
  author={Zenglin Shi, Ying Sun, Mengmi Zhang},
  booktitle={WACV},
  year={2024}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages