cs.CVNov 24, 2026

LGCount: Layout-Guided Diffusion for Zero-Shot Object Counting

Authors: Adriano D'Alessandro, Ali Mahdavi-Amiri, Ghassan Hamarneh

Organizations: Simon Fraser University, Burnaby, Canada

Abstract

Class-agnostic counting requires the user to specify what to count, usually with a class name or a few annotated boxes. We propose a richer text-based specification: a structured layout that names the target, the region that holds it, the distractors to ignore. A prompt upsampler writes this layout from the image and the requested category alone, and an image-editing diffusion model, adapted into a single-step counter, turns it into a density map. Because counting datasets pair each image with a single valid density map, a counter trained on it learns to ignore the layout. We therefore train on synthetic counterfactuals in which one image admits several valid density maps, so that the layout cannot be ignored. On FSC-147 we improve on the previous zero-shot state of the art and we set the best reported result on LOOKALIKES while being told the least about each image. A single photograph can be counted by category, by region, or by granularity without retraining.

Figures & tables

Appendix figures & tables2 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. RECOUNT: Reference-guided Counting with Synthetic Visual Exemplars

    Aug 20, 2026Adriano D'Alessandro, Ali Mahdavi-Amiri, Ghassan HamarnehObject CountingVisual Counting

  2. Count Anything

    May 29, 2026Mengqi Lei, Shuokun Cheng, Wei Bao +4Object CountingVisual Counting

  3. AdaCount: Training-Free Similarity-Guided Spatial and Feature Adaptation for Zero-Shot Object Counting

    Jul 2, 2026Muhammad Ibraheem Siddiqui, Muhammad Haris KhanTest-Time AdaptationVision Foundation Model Adaptation