how many?:一款完全离线、开源的 Android 拍照数数应用
EiSiMo/howmany
开源 Android 应用 how many? 让你拍照后框选一个物体,即可自动标出并统计照片中所有相似物体,全程在手机本地运行,无联网权限,照片不出设备。它基于 GeCo2 少样本计数模型(MIT),在 FSC-147 的 100 张测试图上,三分之二的计数结果与真实数量误差在 10% 以内。应用采用 MIT 许可,需 JDK 21 与 Android SDK 构建。
how many?
An Android app that counts objects in a photo, fully offline and open source.
| Take a Photo | Mark one Object | Get the Count | Verify Results |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |

![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
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
Usage
- Take a photo or pick one from your gallery.
- Drag a box around one of the objects you want to count.
- Tap Count. how many? marks every object that looks like it.
- 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 installReleasemodel/ 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.
来源:GitHub · github.com







































