paper

Count Anything

arXiv:2605.30846

Abstract

Object counting remains largely fragmented across domain-specific datasets and task formulations, despite the rapid progress of generalist vision models. Existing counting models are often tailored to particular scenarios, such as crowds, vehicles, and cells, and therefore struggle to generalize across categories, visual domains, object scales, and density distributions. In this paper, we aim to count arbitrary targets specified by text across diverse visual domains, with every count supported by localized instances. This formulation unifies category-conditioned counting with interpretable spatial localization. To support this goal, we construct CLOC, a Cross-domain Large-scale Object Counting dataset that unifies heterogeneous annotations into a consistent counting format, comprising about 220K images, 619 categories, and 15M instances across six visual domains. Based on CLOC, we propose Count Anything, a generalist model for cross-domain text-guided counting that predicts discrete instance points rather than density maps. To accommodate variations in object scale and density, it performs dual-granularity instance enumeration: a Region-level Sparse Counter provides object-level anchoring for large and sparse targets, while a Pixel-level Dense Counter captures small, crowded, and weakly bounded targets through dense point prediction. A point-centric supervision strategy enables learning from heterogeneous annotations, and Complementary Count Fusion combines the outputs of both decoding branches based on their locations and confidence scores. Experiments on CLOC show that Count Anything reduces MAE from 23.38 (CountGD++) to 9.34 and achieves the best accuracy in all six domains, substantially outperforming existing open-world methods. Code and data are released at: https://github.com/Mengqi-Lei/count-anything