# Training-free Object Counting with Prompts

arXiv: https://arxiv.org/abs/2307.00038 · HTML: https://mlsanity.com/paper/2307.00038/

## Key facts

- Cited by 34 papers in the map (data through 14 Oct 2026).
- Builds on 21 of its 37 references that are in the map.
- First posted on arXiv 30 Jun 2023.

## Builds on (most cited first, 21 of 21)

- [Learning Transferable Visual Models From Natural Language Supervision](https://mlsanity.com/paper/2103.00020/) (2021)
- [Segment Anything](https://mlsanity.com/paper/2304.02643/) (2023)
- [Drone-based Object Counting by Spatially Regularized Regional Proposal Network](https://mlsanity.com/paper/1707.05972/) (2017)
- [Learning To Count Everything](https://mlsanity.com/paper/2104.08391/) (2021)
- [A Closer Look at the Explainability of Contrastive Language-Image Pre-training](https://mlsanity.com/paper/2304.05653/) (2023)
- [Class-Agnostic Counting](https://mlsanity.com/paper/1811.00472/) (2018)
- [Represent, Compare, and Learn: A Similarity-Aware Framework for Class-Agnostic Counting](https://mlsanity.com/paper/2203.08354/) (2022)
- [Few-shot Object Counting with Similarity-Aware Feature Enhancement](https://mlsanity.com/paper/2201.08959/) (2022)
- [Zero-shot Object Counting](https://mlsanity.com/paper/2303.02001/) (2023)
- [Rethinking Spatial Invariance of Convolutional Networks for Object Counting](https://mlsanity.com/paper/2206.05253/) (2022)
- [Learning Spatial Awareness to Improve Crowd Counting](https://mlsanity.com/paper/1909.07057/) (2019)
- [Counting with Focus for Free](https://mlsanity.com/paper/1903.12206/) (2019)
- [Exemplar Free Class Agnostic Counting](https://mlsanity.com/paper/2205.14212/) (2022)
- [Finding any Waldo: zero-shot invariant and efficient visual search](https://mlsanity.com/paper/1807.10587/) (2018)
- [Crowd Counting Using Scale-Aware Attention Networks](https://mlsanity.com/paper/1903.02025/) (2019)
- [Improving the Learning of Multi-column Convolutional Neural Network for Crowd Counting](https://mlsanity.com/paper/1909.07608/) (2019)
- [Visual Search Asymmetry: Deep Nets and Humans Share Similar Inherent Biases](https://mlsanity.com/paper/2106.02953/) (2021)
- [Coarse- and Fine-grained Attention Network with Background-aware Loss for Crowd Density Map Estimation](https://mlsanity.com/paper/2011.03721/) (2020)
- [Look Twice: A Generalist Computational Model Predicts Return Fixations across Tasks and Species](https://mlsanity.com/paper/2101.01611/) (2021)
- [Focus for Free in Density-Based Counting](https://mlsanity.com/paper/2306.05129/) (2023)
- [Understanding the impact of mistakes on background regions in crowd counting](https://mlsanity.com/paper/2003.13759/) (2020)

## Built on by (most cited first, 30 of 34)

- [Point, Segment and Count: A Generalized Framework for Object Counting](https://mlsanity.com/paper/2311.12386/) (2023)
- [Token Activation Map to Visually Explain Multimodal LLMs](https://mlsanity.com/paper/2506.23270/) (2025)
- [Zero-shot Object Counting with Good Exemplars](https://mlsanity.com/paper/2407.04948/) (2024)
- [LVLM-COUNT: Enhancing the Counting Ability of Large Vision-Language Models](https://mlsanity.com/paper/2412.00686/) (2024)
- [T2ICount: Enhancing Cross-modal Understanding for Zero-Shot Counting](https://mlsanity.com/paper/2502.20625/) (2025)
- [CountQA: How Well Do MLLMs Count in the Wild?](https://mlsanity.com/paper/2508.06585/) (2025)
- [OmniCount: Multi-label Object Counting with Semantic-Geometric Priors](https://mlsanity.com/paper/2403.05435/) (2024)
- [Mind the Prompt: A Novel Benchmark for Prompt-based Class-Agnostic Counting](https://mlsanity.com/paper/2409.15953/) (2024)
- [A Fixed-Point Approach to Unified Prompt-Based Counting](https://mlsanity.com/paper/2403.10236/) (2024)
- [CountGD++: Generalized Prompting for Open-World Counting](https://mlsanity.com/paper/2512.23351/) (2025)
- [A Survey on Class-Agnostic Counting: Advancements from Reference-Based to Open-World Text-Guided Approaches](https://mlsanity.com/paper/2501.19184/) (2025)
- [CountingDINO: A Training-free Pipeline for Class-Agnostic Counting using Unsupervised Backbones](https://mlsanity.com/paper/2504.16570/) (2025)
- [Point-to-Region Loss for Semi-Supervised Point-Based Crowd Counting](https://mlsanity.com/paper/2505.21943/) (2025)
- [Learning to Count without Annotations](https://mlsanity.com/paper/2307.08727/) (2023)
- [Visual Enumeration Remains Challenging for Multimodal Generative AI](https://mlsanity.com/paper/2402.03328/) (2024)
- [Industrial Segment Anything -- a Case Study in Aircraft Manufacturing, Intralogistics, Maintenance, Repair, and Overhaul](https://mlsanity.com/paper/2307.12674/) (2023)
- [Boosting Few-Shot Semantic Segmentation Via Segment Anything Model](https://mlsanity.com/paper/2401.09826/) (2024)
- [CountLoop: Training-Free High-Instance Image Generation via Iterative Agent Guidance](https://mlsanity.com/paper/2508.16644/) (2025)
- [A Simple-but-effective Baseline for Training-free Class-Agnostic Counting](https://mlsanity.com/paper/2403.01418/) (2024)
- [SOS: Segment Object System for Open-World Instance Segmentation With Object Priors](https://mlsanity.com/paper/2409.14627/) (2024)
- [TFCounter:Polishing Gems for Training-Free Object Counting](https://mlsanity.com/paper/2405.02301/) (2024)
- [PerSense: Training-Free Personalized Instance Segmentation in Dense Images](https://mlsanity.com/paper/2405.13518/) (2024)
- [Mutually-Aware Feature Learning for Few-Shot Object Counting](https://mlsanity.com/paper/2408.09734/) (2024)
- [What is the Right Embedding Space for Contrastive Learning in Referring Expression Counting?](https://mlsanity.com/paper/2505.22850/) (2025)
- [Towards PerSense++: Advancing Training-Free Personalized Instance Segmentation in Dense Images](https://mlsanity.com/paper/2508.14660/) (2025)
- [Does it Really Count? Assessing Semantic Grounding in Text-Guided Class-Agnostic Counting](https://mlsanity.com/paper/2605.02752/) (2026)
- [Assessing the Visual Enumeration Abilities of Specialized Counting Architectures and Vision-Language Models](https://mlsanity.com/paper/2512.15254/) (2025)
- [OCCAM: Class-Agnostic, Training-Free, Prior-Free and Multi-Class Object Counting](https://mlsanity.com/paper/2601.13871/) (2026)
- [CountEx: Fine-Grained Counting via Exemplars and Exclusion](https://mlsanity.com/paper/2602.19432/) (2026)
- [AdaCount: Training-Free Similarity-Guided Spatial and Feature Adaptation for Zero-Shot Object Counting](https://mlsanity.com/paper/2607.02139/) (2026)

## Abstract (arXiv)

This paper tackles the problem of object counting in images. Existing approaches rely on extensive training data with point annotations for each object, making data collection labor-intensive and time-consuming. To overcome this, we propose a training-free object counter that treats the counting task as a segmentation problem. Our approach leverages the Segment Anything Model (SAM), known for its high-quality masks and zero-shot segmentation capability. However, the vanilla mask generation method of SAM lacks class-specific information in the masks, resulting in inferior counting accuracy. To overcome this limitation, we introduce a prior-guided mask generation method that incorporates three types of priors into the segmentation process, enhancing efficiency and accuracy. Additionally, we tackle the issue of counting objects specified through text by proposing a two-stage approach that combines reference object selection and prior-guided mask generation. Extensive experiments on standard datasets demonstrate the competitive performance of our training-free counter compared to learning-based approaches. This paper presents a promising solution for counting objects in various scenarios without the need for extensive data collection and counting-specific training. Code is available at urlhttps://github.com/shizenglin/training-free-object-counter
