# yasha-2006/plant_leaf_disease architecture

> Architecture diagram of the GitHub repository yasha-2006/plant_leaf_disease, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yasha-2006/plant_leaf_disease
- Repository: https://github.com/yasha-2006/plant_leaf_disease

## Overview

This is a Streamlit plant-disease recognition app. A user selects the recognition page, uploads an image, and requests a prediction; the app preprocesses the image, runs a TensorFlow model, and displays one of three class labels. The model is downloaded from Google Drive when absent. The repository is very small, so the graph reflects the workflow implemented in app.py rather than adding unshown subsystems.

Main entry points: [`app.py`](https://github.com/yasha-2006/plant_leaf_disease/blob/main/app.py) (Loaded model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_ui["Streamlit interface<br/>[app.py]"]
  node_image["Uploaded image<br/>[app.py]"]
  node_result["Displayed prediction<br/>[app.py]"]
end

subgraph group_inference["Model inference"]
  node_preprocess["Image preprocessing<br/>[app.py]"]
  node_model["Loaded model<br/>[app.py]"]
  node_labels["Class labels<br/>[app.py]"]
  node_artifact["Model artifact<br/>[app.py]"]
end

node_user(("User"))
node_drive["Google Drive"]

node_user -->|"selects page"| node_ui
node_user -->|"uploads image"| node_image
node_user -->|"requests prediction"| node_ui
node_drive -->|"provides model"| node_artifact
node_artifact -->|"loads"| node_model
node_image -->|"resizes and batches"| node_preprocess
node_preprocess -->|"predicts on"| node_model
node_model -->|"returns class index"| node_labels
node_labels -->|"formats prediction"| node_result
node_result -->|"displays"| node_ui

click node_ui "https://github.com/yasha-2006/plant_leaf_disease/blob/main/app.py"
click node_image "https://github.com/yasha-2006/plant_leaf_disease/blob/main/app.py"
click node_preprocess "https://github.com/yasha-2006/plant_leaf_disease/blob/main/app.py"
click node_model "https://github.com/yasha-2006/plant_leaf_disease/blob/main/app.py"
click node_labels "https://github.com/yasha-2006/plant_leaf_disease/blob/main/app.py"
click node_result "https://github.com/yasha-2006/plant_leaf_disease/blob/main/app.py"
click node_artifact "https://github.com/yasha-2006/plant_leaf_disease/blob/main/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_ui,node_image,node_result,node_user toneBlue
class node_preprocess,node_model,node_labels,node_artifact toneAmber
class node_drive toneIndigo
```

## Components

### User interface

- [Streamlit interface](https://github.com/yasha-2006/plant_leaf_disease/blob/main/app.py): `app.py`
- [Uploaded image](https://github.com/yasha-2006/plant_leaf_disease/blob/main/app.py): `app.py`
- [Displayed prediction](https://github.com/yasha-2006/plant_leaf_disease/blob/main/app.py): `app.py`

### Model inference

- [Image preprocessing](https://github.com/yasha-2006/plant_leaf_disease/blob/main/app.py): `app.py`
- [Loaded model](https://github.com/yasha-2006/plant_leaf_disease/blob/main/app.py): `app.py`
- [Class labels](https://github.com/yasha-2006/plant_leaf_disease/blob/main/app.py): `app.py`
- [Model artifact](https://github.com/yasha-2006/plant_leaf_disease/blob/main/app.py): `app.py`

### Other components

- **User**
- **Google Drive**

## Connections

- User → Streamlit interface: selects page (evidence: `app.py`)
- User → Uploaded image: uploads image (evidence: `app.py`)
- User → Streamlit interface: requests prediction (evidence: `app.py`)
- Google Drive → Model artifact: provides model (evidence: `app.py`)
- Model artifact → Loaded model: loads (evidence: `app.py`)
- Uploaded image → Image preprocessing: resizes and batches (evidence: `app.py`)
- Image preprocessing → Loaded model: predicts on (evidence: `app.py`)
- Loaded model → Class labels: returns class index (evidence: `app.py`)
- Class labels → Displayed prediction: formats prediction (evidence: `app.py`)
- Displayed prediction → Streamlit interface: displays (evidence: `app.py`)
