Skip to content

jerpelhan/GECO2

Repository files navigation

GeCo2 - Generalized-Scale Object Counting with Gradual Query Aggregation

Official repository of GeCo2
🏆 Accepted to AAAI 2026
📄 Read the paper: GeCo2 PDF


Geco2_architevture-1

Abstract

Few-shot detection-based counters estimate the number of category instances in an image using only a few test-time exemplars. Existing methods often rely on ad-hoc image upscaling and tiling to detect small, densely packed objects, and they struggle when object sizes vary widely within a single image.
GeCo2 introduces a generalized-scale dense query map that is gradually aggregated across multiple backbone resolutions. Scale-specific query encoders interact with exemplar appearance and shape prototypes at each feature level and then fuse them into a high-resolution query map for detection. This avoids heuristic upscaling/tiling, improves counting and detection accuracy, and reduces memory and runtime. A lightweight SAM2-based mask refinement further polishes box quality.
On standard few-shot counting/detection benchmarks, GeCo2 achieves strong gains in MAE/RMSE and AP/AP50, while running ~3× faster with a smaller GPU footprint.


Highlights

GECO2_first_image_motivation_neurips-1
  • 🔁 Gradual cross-scale query aggregation → one high-res dense query map without tiling.
  • 🧩 Per-scale exemplar interaction with appearance + shape prototypes.
  • Fast & memory-efficient inference.
  • 📈 Strong results on FSCD147, FSCD-LVIS, and MCAC (few-shot & multi-class).

Demo Installation

You can easily install and run the demo using the provided install.sh script.

bash install.sh

Download Weights

Download the model weights from:

👉 CNTQG_multitrain_ca44.pth

and place the file in the project root directory.

Launch the Demo

Then run:

python demo_gradio.py

GeCoV2Qualitative_segmentation-1

Citation

If you find this work useful, please cite:

@inproceedings{pelhan2026generalized,
  title={Generalized-Scale Object Counting with Gradual Query Aggregation},
  author={Pelhan, Jer and Lukezic, Alan and Kristan, Matej},
  booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
  pages={},
  year={2026}
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published