Skip to content

About

uses lightweight ai models to count calories of food in pictures.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

Repository files navigation

Food Tracker

A small, client-side food photo tracker. Snap a photo with the in-app camera (or upload, drag and drop, or paste one). It's analyzed as soon as it's chosen. Review the detected food and its estimated nutrition, adjust the portion in grams, then add it to today's log.

The camera uses getUserMedia, which needs HTTPS or localhost. When it isn't available, the Camera button falls back to the device's native photo picker.

What the estimate means

The shipped Swin Food-101 model identifies one of 101 food categories in the browser. The app then uses a local reference nutrition profile for that food. It does not measure calories or portion size directly from a photograph. Always review the detected food and grams before logging; this is not medical or dietary advice.

No photo, food log, or model inference is sent to an application server. The model is downloaded from Hugging Face and cached by the browser for later use.

Run locally

Serve the repository over HTTP, then open the local address in a browser:

python -m http.server 8000

Test

npm ci
npm test

The browser test uses a deterministic ONNX Runtime stub. It verifies upload, camera capture (Chromium's fake video device), inference flow, portion editing, logging, cache/session invalidation, and the browser unit suite without downloading the production model.

Model

The default model is onnx-community/swin-finetuned-food101-ONNX (Apache-2.0). The application loads its quantized ONNX file directly from Hugging Face.

About

uses lightweight ai models to count calories of food in pictures.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages