# aurora-llin/sea-cuisine-nutrition-estimation architecture

> Architecture diagram of the GitHub repository aurora-llin/sea-cuisine-nutrition-estimation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aurora-llin/sea-cuisine-nutrition-estimation
- Repository: https://github.com/aurora-llin/sea-cuisine-nutrition-estimation

## Overview

This Streamlit application turns an uploaded food image into an editable ingredient list and a nutrition estimate. The main workflow classifies the dish, optionally detects ingredients, combines those with recipe ingredients for user correction, and calculates nutrition from Google Sheets data. The sampled code confirms the model, detector, and nutrition-data interfaces; README statements support the user-facing sequence. The app excerpt is partial, so details of omitted UI and calculation code are not inferred.

Main entry points: [`src/app.py`](https://github.com/aurora-llin/sea-cuisine-nutrition-estimation/blob/main/src/app.py) (Streamlit app), [`src/database.py`](https://github.com/aurora-llin/sea-cuisine-nutrition-estimation/blob/main/src/database.py) (Nutrition calculation), [`src/model_utils.py`](https://github.com/aurora-llin/sea-cuisine-nutrition-estimation/blob/main/src/model_utils.py) (Dish classification), [`model/efficientnet-b0.pth`](https://github.com/aurora-llin/sea-cuisine-nutrition-estimation/blob/main/model/efficientnet-b0.pth) (EfficientNet weights)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["User workflow"]
  node_app["Streamlit app<br/>[app.py]"]
  node_ingredient_edit["Ingredient review<br/>[app.py]"]
  node_estimate["Nutrition results<br/>[app.py]"]
end

subgraph group_inference["Image inference"]
  node_classification["Dish classification<br/>[model_utils.py]"]
  node_weights["EfficientNet weights"]
  node_detection["Ingredient detection"]
end

subgraph group_nutrition["Nutrition data"]
  node_nutrition_calc["Nutrition calculation<br/>[database.py]"]
  node_sheets[("Google Sheets")]
end

node_user(("User"))

node_user -->|"uploads image"| node_app
node_app -->|"classifies image"| node_classification
node_classification -->|"loads weights"| node_weights
node_app -.->|"optionally detects"| node_detection
node_app -->|"prepares ingredients"| node_ingredient_edit
node_user -->|"confirms amounts"| node_ingredient_edit
node_ingredient_edit -->|"submits amounts"| node_nutrition_calc
node_nutrition_calc -->|"reads nutrition data"| node_sheets
node_nutrition_calc -->|"returns estimate"| node_estimate

click node_app "https://github.com/aurora-llin/sea-cuisine-nutrition-estimation/blob/main/src/app.py"
click node_classification "https://github.com/aurora-llin/sea-cuisine-nutrition-estimation/blob/main/src/model_utils.py"
click node_weights "https://github.com/aurora-llin/sea-cuisine-nutrition-estimation/blob/main/model/efficientnet-b0.pth"
click node_ingredient_edit "https://github.com/aurora-llin/sea-cuisine-nutrition-estimation/blob/main/src/app.py"
click node_nutrition_calc "https://github.com/aurora-llin/sea-cuisine-nutrition-estimation/blob/main/src/database.py"
click node_estimate "https://github.com/aurora-llin/sea-cuisine-nutrition-estimation/blob/main/src/app.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_ingredient_edit,node_estimate,node_user toneBlue
class node_classification,node_weights,node_detection toneAmber
class node_nutrition_calc,node_sheets toneMint
```

## Components

### User workflow

- [Streamlit app](https://github.com/aurora-llin/sea-cuisine-nutrition-estimation/blob/main/src/app.py): `src/app.py`
- [Ingredient review](https://github.com/aurora-llin/sea-cuisine-nutrition-estimation/blob/main/src/app.py): `src/app.py`
- [Nutrition results](https://github.com/aurora-llin/sea-cuisine-nutrition-estimation/blob/main/src/app.py): `src/app.py`

### Image inference

- [Dish classification](https://github.com/aurora-llin/sea-cuisine-nutrition-estimation/blob/main/src/model_utils.py): `src/model_utils.py`
- [EfficientNet weights](https://github.com/aurora-llin/sea-cuisine-nutrition-estimation/blob/main/model/efficientnet-b0.pth): `model/efficientnet-b0.pth`
- **Ingredient detection**

### Nutrition data

- [Nutrition calculation](https://github.com/aurora-llin/sea-cuisine-nutrition-estimation/blob/main/src/database.py): `src/database.py`
- **Google Sheets**

### Other components

- **User**

## Connections

- User → Streamlit app: uploads image (evidence: `Readme.md`)
- Streamlit app → Dish classification: classifies image (evidence: `src/app.py`)
- Dish classification → EfficientNet weights: loads weights (evidence: `src/model_utils.py`)
- Streamlit app → Ingredient detection: optionally detects (evidence: `src/app.py`)
- Streamlit app → Ingredient review: prepares ingredients (evidence: `src/app.py`)
- User → Ingredient review: confirms amounts (evidence: `Readme.md`)
- Ingredient review → Nutrition calculation: submits amounts (evidence: `Readme.md`)
- Nutrition calculation → Google Sheets: reads nutrition data (evidence: `src/database.py`)
- Nutrition calculation → Nutrition results: returns estimate (evidence: `Readme.md`)
