Upload conference session photos and get estimates of attendee count, raised hands, and a caption for each photo. Everything runs on your own machine: a Google ADK agent calls a local Ollama vision model, and photos are stored in MinIO AIStor. An optional map shows where each photo was taken, using EXIF GPS.
Use the launcher scripts. They suit machines with less RAM than Docker needs, because no VM runs.
Prerequisites:
-
A free single-node AIStor license saved as
minio.licensein the repo root. Get it from the MinIO pricing page (free tier). -
Ollama installed, with one vision model pulled:
ollama pull qwen2.5vl:7b # ~5 GB. Use qwen2.5vl:3b on low-RAM machines (~3.5 GB) -
uv and Node.js 24 LTS (v24.14.1, pinned in
.nvmrc;package.jsonenforces>=24.14.1).
Then run the launcher for your platform:
# Windows PowerShell (lowest RAM, no VM overhead)
.\scripts\dev.ps1# WSL2, Linux, macOS
chmod +x scripts/dev.sh
./scripts/dev.shBoth scripts read .env (created from .env.example on first run), download the MinIO server and client into .bin/, create the snaps and analysis buckets, create the scoped crowd-counter service user, and start the ADK agent and the Next.js app.
Open http://localhost:3000 and upload a photo.
| Service | URL |
|---|---|
| Web app | http://localhost:3000 |
| Agent health | http://localhost:8000/health |
| AIStor console | http://localhost:9001 (minioadmin / minioadmin) |
GPU: AIStor does not use a GPU. Object storage is CPU and I/O bound, so a GPU machine gains nothing there. The GPU matters for Ollama. When Ollama runs on the host (the launcher scripts above), its native Windows, Linux, and macOS builds use an NVIDIA GPU (CUDA) or Apple Metal automatically; run ollama ps to see the GPU share. In Docker, enable GPU access in Docker Desktop (WSL2 backend) and uncomment the deploy.resources.reservations block on the ollama service in docker-compose.yml.
If you prefer to start each service yourself:
- Start AIStor with
MINIO_ROOT_USERandMINIO_ROOT_PASSWORDset:minio server .minio-data --license minio.license --console-address ":9001" - Provision storage with
mc: set an alias, runmc mb --ignore-existing local/snaps local/analysis, then create thecrowd-counterpolicy and service user exactly asscripts/dev.shdoes. - Start the agent:
cd agent && uv sync && uv run smart-crowd-counter-agentwithOLLAMA_BASE_URLandAGENT_MODELset. - Start the web app:
npm ci && npm run devwithS3_ENDPOINT,S3_ACCESS_KEY,S3_SECRET_KEY, andAGENT_URLset. See.env.example.
Use Docker only if you can give Docker 16 GB of RAM. On Windows, use Docker Desktop with the WSL2 backend and set the VM memory in %USERPROFILE%\.wslconfig:
[wsl2]
memory=16GB
processors=8
autoMemoryReclaim=gradualThen run wsl --shutdown to apply. Defaults are fine on Linux and macOS.
git clone https://github.com/kameshsampath/smart-crowd-counter.git
cd smart-crowd-counter
docker compose up --build -d
docker compose exec ollama ollama pull qwen2.5vl:7b # once, ~5 GBThe aistor-init job waits for AIStor, creates the snaps and analysis buckets, and provisions the crowd-counter service user. The web app uses that user, not the root credentials.
To run Ollama on the host instead of in a container, set COMPOSE_OLLAMA_URL=http://host.docker.internal:11434 in .env. The agent resolves host.docker.internal through the host-gateway mapping (built in on Windows and macOS, declared for Linux in docker-compose.yml).
No AIStor license yet? Point S3_ENDPOINT at any S3-compatible store, for example community MinIO. The app only uses the S3 API.
flowchart LR
B["Browser"] -->|"HTTP"| W["Next.js web app :3000"]
W -->|"S3 API"| M["MinIO AIStor :9000<br/>snaps + analysis buckets"]
W -->|"POST /analyze"| A["ADK agent :8000"]
A -->|"S3 GET photo"| M
A -->|"ollama_chat"| O["Ollama :11434"]
O --> V["vision model<br/>default qwen2.5vl:7b"]
sequenceDiagram
participant B as Browser
participant W as Next.js
participant S as AIStor (S3)
participant A as ADK agent
participant O as Ollama
B->>W: POST /api/upload (photos)
W->>S: PUT photo, EXIF GPS as object metadata
W-->>B: uploaded paths + locationWarning
B->>W: GET /api/images
W->>S: list photos, read cached results
W->>A: POST /analyze (uncached photo paths)
A->>S: GET photo bytes
A->>O: vision model call
O-->>A: JSON: attendees, hands, caption
A-->>W: analysis
W->>S: cache result in analysis bucket
W-->>B: dashboard JSON
- Upload JPG, JPEG, or PNG photos, up to 4 at a time, 3.75 MB and 8000 x 8000 px each. Oversized photos are rejected in the browser before upload.
- Per-photo attendee and raised-hand estimates and a caption, from one vision-model call per photo. Results are cached, so repeat views are free.
- Dashboard with a hands-up donut chart and light and dark themes.
- Session map with GPS pins from EXIF, linked back to the source photo.
- Shared photo library with a confirmed reset flow. A retry token protects cleanup against partial failures.
Map pins come from EXIF GPS in the photo. Converting HEIC to JPG often drops the location. Many converters strip EXIF, and iPhone Share > Options > Location: off removes it on purpose. Check a file directly:
node scripts/check-gps.mjs path/to/photo.jpgIf gps is null, re-export the photo with location included. Uploads also return a warning ("N of M photos had no GPS location..."), so missing pins are never silent.
npm test
npm run buildAfter docker compose up or scripts/dev.*, check that the homepage, /api/file-count, and a static asset return HTTP 200. Then upload and analyze a real conference photo. First analysis can take tens of seconds on local hardware.
| Route | Purpose |
|---|---|
POST /api/upload |
Validated upload to the snaps bucket (GPS stored as object metadata) |
GET /api/images |
Runs crowd and hands-up analysis via the ADK agent (long-running, cached) |
GET /api/file-count |
Photo count, no model calls |
GET /api/stage-image?path= |
Same-origin image proxy from object storage |
POST /api/reset |
Clears the shared photo library (requires confirmation) |
GET /api/locations |
GPS-only refresh, no model calls |
GET /api/tiles?z=&x=&y= |
Same-origin OpenStreetMap tile proxy |
Reset removes both the photo from snaps and its cached <photo>.json from analysis. The analysis cache removal is best-effort, so a failed delete can leave an orphan JSON in analysis; the app never shows it, because the photo list comes from snaps.
To see what is stored, sign in to the AIStor console at http://localhost:9001 with the root credentials (minioadmin by default). Open the snaps bucket, select a photo, and use the Metadata and Tags panels: they show latitude, longitude, analyzed, total_attendees, raised_hands, and caption. From the CLI, mc stat local/snaps/<photo> prints the same metadata and tags.
- Inference is local and free, but slow. Model choice and GPU availability dominate latency.
- This is a shared demo. All app users see the same photo library, and a confirmed reset deletes it for everyone. Restrict access before use.
- Counts are AI estimates, not attendance records. Totals across photos are not unique attendees, and hands-up percentage is not a general engagement metric.
- Open vision models count crowds less accurately than frontier hosted models. Treat estimates as rough.
- Google ADK documentation - the agent framework
- Ollama - local model runtime
- MinIO AIStor - object storage (free single-node license at the pricing page)
- MinIO client (mc) - CLI used to provision buckets and users
- uv - Python package and project manager for the agent
- Next.js - web framework
- exifr - EXIF and GPS parsing
- sharp - image validation
- Leaflet and OpenStreetMap - session map and tiles
- smart-crowd-counter-demo - the prompt-driven parent repo
- Apache License 2.0 - license text
Apache-2.0. Copyright 2026 Kamesh Sampath. See LICENSE and NOTICE.