# danamistartrail/pcd-nmax-pro-ultra-galaxy architecture

> Architecture diagram of the GitHub repository danamistartrail/pcd-nmax-pro-ultra-galaxy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/danamistartrail/pcd-nmax-pro-ultra-galaxy
- Repository: https://github.com/danamistartrail/pcd-nmax-pro-ultra-galaxy

## Overview

This repository is an image-classification demo for Indonesian food, comparing a classical computer-vision pipeline with a MobileNetV2 model. The user supplies an image through the Streamlit app; the app prepares Model A features and requests predictions from both classifiers, then presents their results and comparisons. Model A’s distinct stages are resizing/blur, HSV-Otsu segmentation, HSV/GLCM feature extraction, and prototype/SVM classification. The repository also includes experiment metrics and segmentation scoring. Edges reflect shown calls or README-documented capabilities; unsampled wiring is not inferred.

Main entry points: [`app.py`](https://github.com/danamistartrail/pcd-nmax-pro-ultra-galaxy/blob/main/app.py) (Streamlit demo), [`src/preprocessing.py`](https://github.com/danamistartrail/pcd-nmax-pro-ultra-galaxy/blob/main/src/preprocessing.py) (Image preprocessing), [`src/feature_extraction.py`](https://github.com/danamistartrail/pcd-nmax-pro-ultra-galaxy/blob/main/src/feature_extraction.py) (HSV and GLCM features), [`src/evaluation.py`](https://github.com/danamistartrail/pcd-nmax-pro-ultra-galaxy/blob/main/src/evaluation.py) (Metrics and mask scores)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Demo interface"]
  node_app["Streamlit demo<br/>[app.py]"]
end

subgraph group_classical["Classical vision"]
  node_prep["Image preprocessing<br/>[preprocessing.py]"]
  node_segment["HSV segmentation<br/>[segmentation.py]"]
  node_features["HSV and GLCM features"]
  node_classify["Baseline and Model A"]
end

subgraph group_deep["Deep learning"]
  node_mobilenet["Model B inference<br/>[dl_pipeline.py]"]
end

subgraph group_eval["Evaluation"]
  node_evaluation["Metrics and mask scores<br/>[evaluation.py]"]
end

node_user(("Image user"))

node_user -->|"provides image"| node_app
node_app -->|"converts image"| node_prep
node_app -->|"extracts features"| node_features
node_features -->|"preprocesses image"| node_prep
node_features -->|"creates mask"| node_segment
node_app -->|"requests predictions"| node_classify
node_app -->|"requests inference"| node_mobilenet
node_mobilenet -->|"uses image size"| node_prep
node_classify -->|"computes metrics"| node_evaluation
node_evaluation -->|"preprocesses samples"| node_prep
node_evaluation -->|"scores masks"| node_segment

click node_app "https://github.com/danamistartrail/pcd-nmax-pro-ultra-galaxy/blob/main/app.py"
click node_prep "https://github.com/danamistartrail/pcd-nmax-pro-ultra-galaxy/blob/main/src/preprocessing.py"
click node_segment "https://github.com/danamistartrail/pcd-nmax-pro-ultra-galaxy/blob/main/src/segmentation.py"
click node_features "https://github.com/danamistartrail/pcd-nmax-pro-ultra-galaxy/blob/main/src/feature_extraction.py"
click node_classify "https://github.com/danamistartrail/pcd-nmax-pro-ultra-galaxy/blob/main/src/classical_models.py"
click node_mobilenet "https://github.com/danamistartrail/pcd-nmax-pro-ultra-galaxy/blob/main/src/dl_pipeline.py"
click node_evaluation "https://github.com/danamistartrail/pcd-nmax-pro-ultra-galaxy/blob/main/src/evaluation.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_user toneBlue
class node_prep,node_segment,node_features,node_classify toneAmber
class node_mobilenet toneMint
class node_evaluation toneRose
```

## Components

### Demo interface

- [Streamlit demo](https://github.com/danamistartrail/pcd-nmax-pro-ultra-galaxy/blob/main/app.py): `app.py`

### Classical vision

- [Image preprocessing](https://github.com/danamistartrail/pcd-nmax-pro-ultra-galaxy/blob/main/src/preprocessing.py): `src/preprocessing.py`
- [HSV segmentation](https://github.com/danamistartrail/pcd-nmax-pro-ultra-galaxy/blob/main/src/segmentation.py): `src/segmentation.py`
- [HSV and GLCM features](https://github.com/danamistartrail/pcd-nmax-pro-ultra-galaxy/blob/main/src/feature_extraction.py): `src/feature_extraction.py`
- [Baseline and Model A](https://github.com/danamistartrail/pcd-nmax-pro-ultra-galaxy/blob/main/src/classical_models.py): `src/classical_models.py`

### Deep learning

- [Model B inference](https://github.com/danamistartrail/pcd-nmax-pro-ultra-galaxy/blob/main/src/dl_pipeline.py): `src/dl_pipeline.py`

### Evaluation

- [Metrics and mask scores](https://github.com/danamistartrail/pcd-nmax-pro-ultra-galaxy/blob/main/src/evaluation.py): `src/evaluation.py`

### Other components

- **Image user**

## Connections

- Image user → Streamlit demo: provides image (evidence: `app.py`)
- Streamlit demo → Image preprocessing: converts image (evidence: `app.py`)
- Streamlit demo → HSV and GLCM features: extracts features (evidence: `app.py`)
- HSV and GLCM features → Image preprocessing: preprocesses image (evidence: `src/feature_extraction.py`)
- HSV and GLCM features → HSV segmentation: creates mask (evidence: `src/feature_extraction.py`)
- Streamlit demo → Baseline and Model A: requests predictions (evidence: `app.py`)
- Streamlit demo → Model B inference: requests inference (evidence: `app.py`)
- Model B inference → Image preprocessing: uses image size (evidence: `src/dl_pipeline.py`)
- Baseline and Model A → Metrics and mask scores: computes metrics (evidence: `src/classical_models.py`)
- Metrics and mask scores → Image preprocessing: preprocesses samples (evidence: `src/evaluation.py`)
- Metrics and mask scores → HSV segmentation: scores masks (evidence: `src/evaluation.py`)
