DEV Community

Cover image for CalorieWalk 🌿: Understand Your Meal, Then Step Away and Touch Grass
Mayur P
Mayur P

Posted on AI-assisted

CalorieWalk 🌿: Understand Your Meal, Then Step Away and Touch Grass

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 commercial nutrition and food tracking applications are designed to hook you into endless screen time. They force you to weigh ingredients down to the single gram, scroll through overwhelming databases of brand names, and calculate obsessive deficit math ("You ate 500 kcal, now spend 45 minutes on the treadmill to burn it off").

CalorieWalk is built on the opposite philosophy: Screen time should be the shortest part of your day.

CalorieWalk is a lightweight, privacy-first web application that allows you to photograph or quickly describe a meal. Using a locally running open-weight multimodal AI model, it identifies individual meal components, estimates reasonable portions, and calculates approximate calories.

The moment the meal is logged, the app invites you into "Touch Grass Mode"—a dedicated, minimalist outdoor wellness flow with 10-, 20-, and 30-minute nature walk prompts. It features a distraction-free countdown timer designed so you can put your phone in your pocket, walk outside, look at the sky, and reconnect with the physical world.

Key principles:

  • Zero Exercise Punishment: CalorieWalk never prescribes workouts to "burn off" food. Outdoor strolls are suggested strictly as an independent mental and physical wellness break.
  • Honest Uncertainty: Visual estimates are clearly labeled as approximate, acknowledging that photographic analysis cannot measure hidden cooking oils or exact sodium levels.
  • Privacy First: Photos are processed locally with EXIF metadata stripped, never uploaded to third-party cloud servers, and discarded immediately after inference by default.

Code

The complete source code, Docker setup, and test suite are open source on GitHub:

GitHub logo song-code-won / CalorieWalk

Understand your meal. Then go outside. Hacktoberfest Open-Source AI Challenge.

CalorieWalk 🌿 — Local AI Food & Calorie Estimator

Tagline: Understand your meal. Then go outside.
Challenge: Hacktoberfest Open-Source AI Challenge: Week 1 — “Touch Grass”

CalorieWalk is a lightweight, privacy-first web application designed to help you quickly understand what you eat using a locally running open-weight AI model, and then immediately step away from your device into the fresh air.


🎯 The Problem & Philosophy

Most commercial calorie tracking applications trap you in endless screen cycles: typing endless recipe variants, weighing grains to the single gram, and gamifying obsessive "calorie burn" calculations ("You ate 500 kcal, now run on the treadmill for 45 minutes").

CalorieWalk flips this paradigm:

  1. Screen time is the shortest part of the experience: Snap a meal photo or type a quick food note.
  2. Local Open-Weight AI: Processed right on your device—no cloud uploads, no subscription APIs.
  3. Honest estimates with clear uncertainty: Food…

Repository Link: https://github.com/song-code-won/CalorieWalk


How I Built It

CalorieWalk was designed around an offline-capable, open-weight local inference pipeline without heavyweight cloud dependencies:

  1. Open-Weight Multimodal AI Core:

    • Powered by local open-weight Vision-Language Models running via Ollama (e.g., llava:latest, llama3.2-vision:11b, or qwen2-vl:7b).
    • The vision service cleans and normalizes user uploads, strips GPS and camera EXIF metadata with Pillow, and requests structured JSON outputs with bounded confidence scores.
    • Built with strict schema validation and retry guards to reject hallucinated or invalid model structures.
  2. Backend & Architecture:

    • FastAPI (Python 3.11): High-performance asynchronous REST endpoints for image analysis, manual input, settings, and activity logs.
    • SQLite: Lightweight local persistence storing meal records and completed walks without needing external database servers.
    • Graceful Fallback Dataset: A built-in reference dataset ensures users can still estimate standard meals even if their local model daemon is temporarily offline.
  3. Frontend:

    • Built with clean, accessible HTML5, responsive CSS, and vanilla JavaScript—zero bloated client-side JavaScript frameworks or compilation steps.
    • Features an immersive Touch Grass screen that replaces nutrition metrics with an outdoor countdown prompt.

Why Does Open Innovation Matter?

Meal photographs and daily eating logs are deeply personal data. They reveal your daily routine, physical location, home interior, dining companions, and health habits.

Relying on closed proprietary AI APIs (like OpenAI or cloud computer vision services) means funneling private personal photos to corporate servers for training and retention.

Open-source and open-weight innovation fundamentally solves this:

  • Total Data Privacy: Photos are analyzed directly on your own hardware. Not a single byte leaves the machine.
  • Offline Independence: Once the open-weight model is pulled, your meal logging and outdoor companion function completely without an internet connection.
  • Auditable & Non-Extractive: Anyone can verify that no hidden trackers or biometric harvesting occurs.
  • Zero Cost Barriers: Users and developers avoid recurring token fees, subscription paywalls, or sudden proprietary API deprecations.

Prize Categories

  • Touch Grass Track: Open-weight AI used specifically to reduce screen obsession and encourage users to step outside and experience nature.
  • Open-Source AI / Local Inference: Built entirely around open-weight models running on local hardware without proprietary closed APIs.

Top comments (0)