Skip to content
EiSiMoPublic

About

Count Objects in Photos

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

177 Commits

Folders and files

Repository files navigation

how many? app icon

how many?

An Android app that counts objects in a photo, fully offline and open source.

Kotlin Android 12+ Version 0.1.2 No internet permission MIT license

Take a Photo Mark one Object Get the Count Verify Results
A photo of crates of lemons A box drawn around one lemon 278 lemons counted Zoomed in on the marked lemons
Show 9 more examples
A photo of coins A box drawn around one of the coins 124 coins counted Zoomed in on the marked coins
A photo of windows A box drawn around one of the windows 1,024 windows counted Zoomed in on the marked windows
A photo of birds A box drawn around one of the birds 18 birds counted Zoomed in on the marked birds
A photo of nuts A box drawn around one of the nuts 28 nuts counted Zoomed in on the marked nuts
A photo of DVDs A box drawn around one of the DVDs 236 DVDs counted Zoomed in on the marked DVDs
A photo of paving stones A box drawn around one of the paving stones 686 paving stones counted Zoomed in on the marked paving stones
A photo of boxes of flooring A box drawn around one of the boxes of flooring 68 boxes of flooring counted Zoomed in on the marked boxes of flooring
A photo of jellyfish A box drawn around one of the jellyfish 36 jellyfish counted Zoomed in on the marked jellyfish
A photo of Tic Tacs A box drawn around one of the Tic Tacs 110 Tic Tacs counted Zoomed in on the marked Tic Tacs

A stack of pipes, a crowd of people, a tray of pills: take a photo, draw a box around one of the things you want to count, and how many? finds and marks every object that looks like it. Everything runs on your phone. The app has no internet permission, so no photo ever leaves the device. Watch the full demo on YouTube.

Install · Usage · Accuracy · Building · Contributing · Acknowledgements · License

Install

Get it on GitHub Get it on F-Droid Get it on Google Play
Coming soon Coming soon

Usage

  1. Take a photo or pick one from your gallery.
  2. Drag a box around one of the objects you want to count.
  3. Tap Count. how many? marks every object that looks like it.
  4. Check the result: drag the edges to count only part of the photo, tap a point to remove a wrong one, or tap an object to add one that was missed.

Counting takes a few seconds and works best when the objects are clearly visible and not too small in the photo.

Accuracy

On 100 test images from FSC-147, with one marked object as in the app, two out of three counts are within 10% of the true count. That's why the last step is checking the result: a few taps usually fix the count.

Building

You need JDK 21 and the Android SDK. The build downloads the counting model from this repository's releases. With a phone attached via USB debugging:

cd android
./gradlew installRelease

model/ exports the counting model (uv run modal run export.py, needs uv and a Modal account) and holds the benchmark: uv run benchmark.py. See AGENTS.md for all commands.

Contributing

Contributions are welcome, from bug reports and feature requests to pull requests: open an issue.

how many? counts with GeCo2 as it is; we don't train our own model. So when the app miscounts a photo, that is usually the model's limit, and the way it gets better is a better model. When one comes out, we'll bring it into the app.

Acknowledgements

how many? stands on the shoulders of others' work:

  • GeCo2 by Jer Pelhan, Alan Lukežič and Matej Kristan is the few-shot counting model that does the actual counting (MIT).
  • SAM 2 by Meta, whose image encoder GeCo2 builds on (Apache 2.0).
  • FSC-147 by Viresh Ranjan et al., the dataset GeCo2 learned to count on and our benchmark.
  • ONNX Runtime by Microsoft runs the model on the phone (MIT).
  • Space Grotesk by Florian Karsten is the typeface of the count (OFL).

License

MIT. The app's about page lists the licenses of everything it bundles.

About

Count Objects in Photos

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages