# orkhankhalilzade/gul-xesteligi-app architecture

> Architecture diagram of the GitHub repository orkhankhalilzade/gul-xesteligi-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/orkhankhalilzade/gul-xesteligi-app
- Repository: https://github.com/orkhankhalilzade/gul-xesteligi-app

## Overview

This is a Streamlit rose-leaf diagnosis demo. A user uploads an image; the app displays it, removes background, resizes and batches it, then runs a bundled model to classify it as healthy, rust, or sawfly damage and show confidence scores. The graph separates the interface, image preparation, and diagnosis/result stages. The workflow is visible in app.py; no separate capabilities are documented in the README. The model artifact is present in the tree, but its internals were not inspected.

Main entry points: [`app.py`](https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/app.py) (Image upload), [`best_model_v2.keras`](https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/best_model_v2.keras) (Classifier model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_upload["Image upload<br/>[app.py]"]
  node_preview["Image preview<br/>[app.py]"]
  node_results["Diagnosis results<br/>[app.py]"]
end

subgraph group_image["Image preparation"]
  node_prepare["Image preparation<br/>[app.py]"]
  node_background["Background removal<br/>[app.py]"]
  node_resize["Resize and batch<br/>[app.py]"]
end

subgraph group_diagnosis["Diagnosis"]
  node_loader["Model loader<br/>[app.py]"]
  node_inference["Model inference<br/>[app.py]"]
  node_classify["Class and confidence<br/>[app.py]"]
end

node_user(("User"))
node_model["Classifier model"]

node_user -->|"uploads image"| node_upload
node_upload -->|"displays image"| node_preview
node_upload -->|"provides image"| node_prepare
node_prepare -->|"converts image"| node_background
node_prepare -->|"resizes image"| node_resize
node_loader -->|"loads model"| node_model
node_resize -->|"provides batch"| node_inference
node_inference -->|"predicts with"| node_model
node_inference -->|"returns scores"| node_classify
node_classify -->|"renders diagnosis"| node_results

click node_upload "https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/app.py"
click node_preview "https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/app.py"
click node_prepare "https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/app.py"
click node_background "https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/app.py"
click node_resize "https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/app.py"
click node_loader "https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/app.py"
click node_model "https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/best_model_v2.keras"
click node_inference "https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/app.py"
click node_classify "https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/app.py"
click node_results "https://github.com/orkhankhalilzade/gul-xesteligi-app/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_upload,node_preview,node_results,node_user toneBlue
class node_prepare,node_background,node_resize toneAmber
class node_loader,node_inference,node_classify toneMint
class node_model toneIndigo
```

## Components

### User interface

- [Image upload](https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/app.py): `app.py`
- [Image preview](https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/app.py): `app.py`
- [Diagnosis results](https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/app.py): `app.py`

### Image preparation

- [Image preparation](https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/app.py): `app.py`
- [Background removal](https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/app.py): `app.py`
- [Resize and batch](https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/app.py): `app.py`

### Diagnosis

- [Model loader](https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/app.py): `app.py`
- [Model inference](https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/app.py): `app.py`
- [Class and confidence](https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/app.py): `app.py`

### Other components

- **User**
- [Classifier model](https://github.com/orkhankhalilzade/gul-xesteligi-app/blob/main/best_model_v2.keras): `best_model_v2.keras`

## Connections

- User → Image upload: uploads image (evidence: `app.py`)
- Image upload → Image preview: displays image (evidence: `app.py`)
- Image upload → Image preparation: provides image (evidence: `app.py`)
- Image preparation → Background removal: converts image (evidence: `app.py`)
- Image preparation → Resize and batch: resizes image (evidence: `app.py`)
- Model loader → Classifier model: loads model (evidence: `app.py`)
- Resize and batch → Model inference: provides batch (evidence: `app.py`)
- Model inference → Classifier model: predicts with (evidence: `app.py`)
- Model inference → Class and confidence: returns scores (evidence: `app.py`)
- Class and confidence → Diagnosis results: renders diagnosis (evidence: `app.py`)
