DEV Community

razorbill
razorbill

Posted on

I Stopped Guessing Why My Walk Sucks: Building a Zero-Cloud Street Auditor with Gemma

Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass Submission 🌿

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass

What I Built

Most outdoor and fitness tech introduces a contradictory loop: it encourages you to get outside, then demands that you spend your entire walk staring at an OLED display to check live stats, track badges, or babysit an app interface.

I wanted the opposite: an open-weight tool where screen time outside is under two seconds per snapshot.

I built walkaudit, a lightweight, zero-cloud Python tool that turns an everyday outdoor walk into an empirical pedestrian walkability audit using a local vision model running via Ollama.

Instead of relying on vague impressions like "the road behind our hostel is terrible," walkaudit provides structured civic data:

  • You walk down a lane with your phone at chest height, snapping a photo every 25–30 paces and capturing critical hazards (open drains, broken paths) or amenities (shade, benches).
  • You transfer the photos to your laptop via USB cable.
  • A local Gemma model processes each image and extracts strictly constrained JSON categories (footpath, surface, shade, obstructions, hazards, positives).
  • The tool applies transparent arithmetic on those labels to compute an objective 1 to 5 walkability score, highlights the hardest and best spots, and prompts Gemma to generate three prioritized civic action points.
  • Outputs: A standalone audit_report.html visual dashboard and an audit.csv dataset.

It is designed for students, daily walkers, and local community groups who want to document their street infrastructure empirically without sharing private photos online.


Demo

I field-tested walkaudit on the 350-meter access lane behind my student hostel block across 16 photos taken in daylight.

1. Overall Audit Report & Scores

The aggregate audit revealed an average score of 2.2 / 5.0, with 50% of the lane completely missing a footpath and 81% flagging uneven, broken, or unpaved walking surfaces.

Overall Audit Report

2. Full Walking Order Table & Labeled Hazards

The detailed breakdown captured the contrast between functional sections (interlock pavers, benches) and hazardous stretches (open drain pits, standing water, and construction debris narrowing the pedestrian path):

Audit Table Breakdown

3. Terminal Run (Local Execution)

Local inference ran via Ollama on a consumer laptop GPU with zero external API calls:

Terminal Run Output


Code

GitHub logo Razorbillworks / walkaudit

Street walkability audit from walk photos using local Gemma

walkaudit

Take photos on a walk, get a walkability report for the street.

I wanted to know what was actually wrong with the lane I walk every day, in more detail than "it's bad". So I take a photo every few steps and let a small Gemma model that runs on my own laptop label each one: is there a footpath, what is the ground like, is there shade, is anything blocking the way. The tool turns the labels into a one-page report with the worst spots, the best spots and three things to fix first.

The report

Taking the photos

  1. Pick a street or lane you can walk in 10 to 15 minutes, in daylight.
  2. Hold the phone at chest height, pointed along the way you are walking, with the ground in the frame.
  3. Take a photo every 25 to 30 steps, and one more wherever something is wrong (broken pavement…

GitHub Repository: https://github.com/Razorbillworks/walkaudit

Licensed under the MIT License.


How I Built It

  • Open-Weight Model: Google's Gemma (gemma4:e2b) running locally via Ollama.
  • Zero-Dependency Architecture: walkaudit.py relies exclusively on Python standard libraries (urllib.request, json, csv, html, argparse, pathlib). There are no complex virtual environments or package installations required.
  • Constrained JSON Schema: The prompt strictly enforces structured JSON extraction from Gemma. Invalid tags are discarded, and fallbacks are handled deterministically.
  • Deterministic Math over Hallucinated Scores: Instead of asking an LLM to generate an arbitrary rating, the 1–5 score is computed with fixed Python arithmetic:
s = 5.0
s -= {"absent": 2.0, "partial": 1.0}.get(r["footpath"], 0)
s -= {"uneven": 1.0, "broken": 2.0, "unpaved": 1.0}.get(r["surface"], 0)
s -= min(1.5, 0.5 * len(r["obstructions"]))
s -= min(1.0, 0.5 * len(r["hazards"]))
if r["shade"] == "none":
    s -= 0.5
s += min(0.5, 0.25 * len(r["positives"]))
return max(1.0, min(5.0, round(s * 2) / 2))
Enter fullscreen mode Exit fullscreen mode
  • Local Caching: Images are cached in audit_cache.json keyed by file size and model name. Interrupted runs can be resumed instantly without reprocessing completed images.

Why Does Open Innovation Matter?

For local physical infrastructure and civic mapping, closed cloud APIs introduce fundamental problems:

  1. Uncompromised Street Privacy: Neighborhood street photography inevitably captures residential doorways, building gates, and passersby. Uploading raw images to proprietary third-party servers creates unnecessary privacy risks. With local open-weight models, image buffers exist strictly in memory on the local machine and never leave it.
  2. Zero Marginal Cost: Commercial vision endpoints charge per image token. Auditing a 5 km neighborhood route requires hundreds of snapshots, creating budget barriers for student clubs or civic groups. Open models on consumer hardware cost zero marginal dollars.
  3. Reproducibility: Proprietary cloud APIs change, deprecate endpoints, or alter internal safety alignments without notice. Running open weights locally guarantees that an audit performed today will run identically next year.

Prize Categories

  • Best Use of Gemma (runs Google's Gemma model locally via Ollama for multi-image vision extraction and civic synthesis).

Top comments (0)