Enhancing Zero-Shot Object Counting via Text-Guided Local Ranking and Number-Evoked Global Attention

Shiwei Zhang, Qi Zhou, Wei Ke
1/1/2025

No official code found. Best implementation: xiaozhang23957/UPRE-ICCV2025 (30 stars, last commit 2026-04-25). 1 more below.

Abstract

Text-guided zero-shot object counting leverages vision-language models (VLMs) to count objects of an arbitrary class given by a text prompt. Existing approaches for this challenging task only utilize local patch-level features to fuse with text feature, ignoring the important influence of the global image-level feature.

Show full abstract

In this paper, we propose a universal strategy that can exploit both local patch-level features and global image-level feature simultaneously. Specifically, to improve the localization ability of VLMs, we propose Text-guided Local Ranking. Depending on the prior knowledge that foreground patches have higher similarity with the text prompt, a new local-text rank loss is designed to increase the differences between the similarity scores of foreground and background patches which push foreground and background patches apart. To enhance the counting ability of VLMs, Number-evoked Global Attention is introduced to first align global image-level feature with multiple number-conditioned text prompts. Then, the one with the highest similarity is selected to compute cross-attention with the global image-level feature. Through extensive experiments on widely used datasets and methods, the proposed approach has demonstrated superior advancements in performance, generalization, and scalability. Furthermore, to better evaluate text-guided zero-shot object counting methods, we propose a dataset named ZSC-8K, which is larger and more challenging, to establish a new benchmark. Codes and ZSC-8K dataset will be available.

Semantic Scholar

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
xiaozhang23957/UPRE-ICCV2025Community30––2026-04-25
zaqai/LGCountCommunity8PythonMIT2025-11-13

[ICCV2025] UPRE: Zero-Shot Domain Adaptation for Object Detection via Unified Prompt and Representation Enhancement

300Jul 16, 20257 months ago
zaqai/LGCountCommunity65%
MIT

[ICCV2025] Official Repository for "Enhancing Zero-shot Object Counting via Text-guided Local Ranking and Number-evoked Global Attention"

80PythonJun 26, 20251 years agoMIT

Similar Papers

Cite this paper

@article{zhang2025enhancing,
  title  = {Enhancing Zero-Shot Object Counting via Text-Guided Local Ranking and Number-Evoked Global Attention},
  author = {Shiwei Zhang and Qi Zhou and Wei Ke},
  year   = {2025},
  url    = {https://api.semanticscholar.org/CorpusID:b1b0129d4429df02c2a3fffb8ad538c3ebe8ac61},
  journal = {IEEE International Conference on Computer Vision}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/b1b0129d4429df02c2a3fffb8ad538c3ebe8ac61.svg)](https://codeofpaper.com/paper/b1b0129d4429df02c2a3fffb8ad538c3ebe8ac61)

Discussion