CountGD++: Generalized Prompting for Open-World Counting
Niki Amini-Naieni, Andrew Zisserman
TL;DR
CountGD++ addresses open-world object counting by enabling negative prompts, automatic generation of visual exemplars (pseudo-exemplars), and adoption of external exemplars, all within a unified transformer-based counting model. The architecture integrates positive/negative text and visual prompts, external exemplar streams, and a cross-modality processing pipeline that yields 900 object queries and robust filtering. Training combines a multi-term loss with a contrastive component, mosaic data augmentation, and Hungarian matching to align predictions, while inference uses adaptive cropping to scale to dense scenes and pseudo-exemplar feedback to refine counts. The paper also demonstrates how CountGD++ can serve as a counting expert agent for LLMs, enabling synthetic/external exemplars and iterative prompting for images and videos, achieving state-of-the-art results across several benchmarks. The results show broad generalization, efficiency gains, and potential impact across medicine, materials science, and agriculture.
Abstract
The flexibility and accuracy of methods for automatically counting objects in images and videos are limited by the way the object can be specified. While existing methods allow users to describe the target object with text and visual examples, the visual examples must be manually annotated inside the image, and there is no way to specify what not to count. To address these gaps, we introduce novel capabilities that expand how the target object can be specified. Specifically, we extend the prompt to enable what not to count to be described with text and/or visual examples, introduce the concept of `pseudo-exemplars' that automate the annotation of visual examples at inference, and extend counting models to accept visual examples from both natural and synthetic external images. We also use our new counting model, CountGD++, as a vision expert agent for an LLM. Together, these contributions expand the prompt flexibility of multi-modal open-world counting and lead to significant improvements in accuracy, efficiency, and generalization across multiple datasets. Code is available at https://github.com/niki-amini-naieni/CountGDPlusPlus.
