How shubham0207k/food-calorie-app works
FoodVision AI recognizes food images, returns predictions, and can enrich results with nutrition data. Its broader documented architecture centers on a reusable Food Knowledge Base, populated by import workflows and checked by an auditor; USDA matching supports nutrition lookup and data mapping. The sampled Flask entry point and service excerpts substantiate parts of the runtime path, while the tree and README identify other major subsystems. Some route and importer internals were not sampled, so uncertain links are omitted or marked unverified.
Main entry points: audit.py Knowledge-base audit · main.py Flask application · import_food101.py Food-101 importer · import_fruits.py Fruit importer
Components 24
Recognition and nutrition
- Flask application
main.py - Food-101 recognition
app/services/food101_service.py - Prediction normalization
app/services/prediction_service.py - Nutrition lookup
app/services/nutrition_service.py - JSON data access
app/services/json_db.py
Food knowledge base
- Food Knowledge Base
- Food import workflows
data/importer - Food-101 importer
data/importer/import_food101.py - Fruit importer
data/importer/import_fruits.py - Vegetable importer
data/importer/import_vegetables.py - Import source loading
data/importer/source_loader.py - Food schema validation
data/importer/validator.py - Collection writer
data/importer/writer.py
USDA integration
- USDA food matching
data/usda/matcher.py - USDA search client
data/usda/usda_client.py - Match confidence
data/usda/confidence.py
Knowledge-base quality
- Knowledge-base audit
data/auditor/audit.py - Manifest checks
data/auditor/manifest_checker.py - Collection schema checks
data/auditor/schema_checker.py - Duplicate checks
data/auditor/duplicate_checker.py - Audit statistics
data/auditor/statistics.py - Audit reports
data/auditor/report.py
Other components
- End user
- USDA FoodData Central
Connections 29
- End user → Flask application: uses
README.md - Flask application → Food-101 recognition: predicts with
main.py - Flask application → Prediction normalization: normalizes
main.py - Flask application → Nutrition lookup: looks up
main.py - Flask application → JSON data access: reads and writes
main.py - Nutrition lookup → USDA food matching: matches food
app/services/nutrition_service.py - Nutrition lookup → USDA search client: searches
app/services/nutrition_service.py - USDA food matching → USDA search client: searches candidates
data/usda/matcher.py - USDA food matching → Match confidence: scores match
data/usda/matcher.py - USDA search client → USDA FoodData Central: queries
data/usda/usda_client.py - Food-101 importer → Import source loading: loads source
data/importer/import_food101.py - Food-101 importer → Food schema validation: validates records
data/importer/import_food101.py - Food-101 importer → Collection writer: writes collections
data/importer/import_food101.py - Fruit importer → Import source loading: loads source
data/importer/import_fruits.py - Fruit importer → Food schema validation: validates records
data/importer/import_fruits.py - Fruit importer → Collection writer: writes collections
data/importer/import_fruits.py - Vegetable importer → Import source loading: loads source
data/importer/import_vegetables.py - Vegetable importer → Food schema validation: validates records
data/importer/import_vegetables.py - Vegetable importer → Collection writer: writes collections
data/importer/import_vegetables.py - Food-101 importer → Food Knowledge Base: populates
data/importer/import_food101.py - Fruit importer → Food Knowledge Base: populates
- Vegetable importer → Food Knowledge Base: populates
- Nutrition lookup → Food Knowledge Base: reads food records
- Knowledge-base audit → Manifest checks: checks manifest
data/auditor/audit.py - Knowledge-base audit → Collection schema checks: checks schema
data/auditor/audit.py - Knowledge-base audit → Duplicate checks: checks duplicates
data/auditor/audit.py - Knowledge-base audit → Audit statistics: computes statistics
data/auditor/audit.py - Knowledge-base audit → Audit reports: produces report
- Collection schema checks → Food schema validation: validates with
data/auditor/schema_checker.py