DEV Community

Forenche
Forenche

Posted on

Fridge List: one photo of your fridge, one grocery list, zero effort

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady

What I Built

Making a grocery list means standing in front of the open fridge, checking every shelf, typing things into your phone, and still forgetting the onions. Fridge List skips all of that.

You take one or two photos of your fridge and shelves, and it gives you:

  • what it can see in there, with rough amounts ("half a carton of milk")
  • a shopping list grouped by store section, as checkboxes you can paste into your notes app
  • one meal you can make right now with what's already there, for when you're too lazy to go shopping at all

You tell it your staples once (milk, eggs, bread, whatever you always want around) and any diet notes, so it knows what "running out" means for you and never suggests things you don't eat.

Code

Fridge List

Take a photo of your fridge, get a grocery list grouped by store section, plus one meal you can make with what's already there.

Runs an open-weight Gemma model through Ollama. No API keys, no account, photos of your kitchen never leave your machine.

Run it

# 1. Install Ollama from https://ollama.com, then:
ollama pull gemma4:e4b

# 2. Install and start the app
pip install -r requirements.txt
python app.py
Enter fullscreen mode Exit fullscreen mode

Open the local URL Gradio prints. Use a bigger model with MODEL=gemma4:26b python app.py, or point at another Ollama host with OLLAMA_URL.

Limits

It only knows what's visible in the photo. Things hidden at the back of a shelf get missed, and it can't tell whether food has gone off. Tell it your staples so it knows what "running out" means for you.

License

MIT




How I Built It

One Python file, about 120 lines.

  • Model: Gemma 4 (gemma4:e4b), Google's open-weight model, running locally through Ollama. Gemma 4 takes images as input, so one small model reads the fridge and writes the list.
  • UI: Gradio. A photo upload, a staples box, a diet box and one button.
  • Images: photos are shrunk to 1024px before they go to the model. Phone photos are huge and it doesn't change what the model can see.
  • Structured output: Ollama's format: "json" mode returns a fixed shape (items seen, shopping list by section, meal idea), which the app turns into a checkbox list.
  • Prompt rules that keep it honest: only flag something as low if it's visibly low, never claim food is expired (it can't know that from a photo), and respect the diet notes in every suggestion.

It's a small edge model looking at a crowded fridge, so it misses things hidden at the back. Treat the list as a strong first draft that took zero effort, not an inventory system.

Why Does Open Innovation Matter?

  • Your kitchen stays private. A photo of your fridge says a lot about your diet, health and household. Running Gemma locally means none of that gets uploaded or logged.
  • Free to use every day. A grocery list is a habit, not a one-off. A paid vision API would charge for every fridge photo; locally it costs nothing, forever.
  • No account, no setup per use. Open the app, drop a photo, done. That's the lazy part.
  • I can swap the model. A bigger Gemma that spots more items is a one-line change (MODEL=...).

Where a closed model would win: a large cloud vision model would recognise more items in a cluttered fridge. For a grocery list you're going to glance at in the shop anyway, free and private is the better deal.

Prize Categories

Best Use of Gemma

Top comments (0)