# ahmednasser5/kemet-vision architecture

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

- Interactive diagram: https://gitdiagram.com/ahmednasser5/kemet-vision
- Repository: https://github.com/ahmednasser5/kemet-vision

## Overview

This repository provides an Egyptian-artifact image recognition experience: a user submits a photo, the application checks whether it resembles the known artifact domain, classifies accepted images, and presents the prediction and confidence details. The router also exposes image-to-query and entity-tracking behavior for a conversational/RAG workflow. The README describes a three-model CLIP verification ensemble and NLP-generated descriptions, but the available source excerpts do not show those implementations or their wiring, so those capabilities are represented as documented, unverified branches. The README also describes a mobile app, but no mobile source is present in this tree.

Main entry points: [`multimodal_router.py`](https://github.com/ahmednasser5/kemet-vision/blob/main/multimodal_router.py) (EfficientNet classifier), [`GUI.py`](https://github.com/ahmednasser5/kemet-vision/blob/main/GUI.py) (Prediction results)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Recognition Interface"]
  node_gui["Streamlit interface<br/>[GUI.py]"]
  node_results["Prediction results<br/>[GUI.py]"]
  node_mobile["Mobile application"]
end

subgraph group_vision["Image Recognition"]
  node_image_input["Image loading"]
  node_camera_detect["Camera detection"]
  node_ood["OOD similarity filter"]
  node_efficientnet["EfficientNet classifier"]
  node_clip["CLIP verifiers"]
  node_vote["Ensemble vote"]
end

subgraph group_conversation["Conversation Context"]
  node_query["RAG query generation"]
  node_entity["Entity extraction"]
  node_sessions[("Entity session store")]
  node_nlp["Artifact description"]
end

node_visitor(("Artifact visitor"))

node_visitor -->|"submits photo"| node_gui
node_gui -.->|"loads image"| node_image_input
node_image_input -->|"checks source"| node_camera_detect
node_camera_detect -->|"selects threshold"| node_ood
node_ood -->|"accepts image"| node_efficientnet
node_efficientnet -.->|"low confidence verifies"| node_clip
node_clip -.->|"casts votes"| node_vote
node_efficientnet -.->|"fallback prediction"| node_vote
node_efficientnet -.->|"returns prediction"| node_results
node_vote -.->|"returns consensus"| node_results
node_results -.->|"shows result"| node_visitor
node_image_input -.->|"generates query"| node_query
node_query -.->|"tracks entity"| node_entity
node_entity -->|"updates entity"| node_sessions
node_visitor -.->|"asks about artifact"| node_nlp
node_efficientnet -.->|"provides class"| node_nlp
node_nlp -.->|"returns description"| node_visitor
node_visitor -.->|"uses app"| node_mobile

click node_gui "https://github.com/ahmednasser5/kemet-vision/blob/main/GUI.py"
click node_image_input "https://github.com/ahmednasser5/kemet-vision/blob/main/multimodal_router.py"
click node_camera_detect "https://github.com/ahmednasser5/kemet-vision/blob/main/multimodal_router.py"
click node_ood "https://github.com/ahmednasser5/kemet-vision/blob/main/multimodal_router.py"
click node_efficientnet "https://github.com/ahmednasser5/kemet-vision/blob/main/multimodal_router.py"
click node_results "https://github.com/ahmednasser5/kemet-vision/blob/main/GUI.py"
click node_query "https://github.com/ahmednasser5/kemet-vision/blob/main/multimodal_router.py"
click node_entity "https://github.com/ahmednasser5/kemet-vision/blob/main/multimodal_router.py"
click node_sessions "https://github.com/ahmednasser5/kemet-vision/blob/main/multimodal_router.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_gui,node_results,node_mobile toneBlue
class node_image_input,node_camera_detect,node_ood,node_efficientnet,node_clip,node_vote toneAmber
class node_query,node_entity,node_sessions,node_nlp toneMint
class node_visitor toneIndigo
```

## Components

### Recognition Interface

- [Streamlit interface](https://github.com/ahmednasser5/kemet-vision/blob/main/GUI.py): `GUI.py`
- [Prediction results](https://github.com/ahmednasser5/kemet-vision/blob/main/GUI.py): `GUI.py`
- **Mobile application**

### Image Recognition

- [Image loading](https://github.com/ahmednasser5/kemet-vision/blob/main/multimodal_router.py): `multimodal_router.py`
- [Camera detection](https://github.com/ahmednasser5/kemet-vision/blob/main/multimodal_router.py): `multimodal_router.py`
- [OOD similarity filter](https://github.com/ahmednasser5/kemet-vision/blob/main/multimodal_router.py): `multimodal_router.py`
- [EfficientNet classifier](https://github.com/ahmednasser5/kemet-vision/blob/main/multimodal_router.py): `multimodal_router.py`
- **CLIP verifiers**
- **Ensemble vote**

### Conversation Context

- [RAG query generation](https://github.com/ahmednasser5/kemet-vision/blob/main/multimodal_router.py): `multimodal_router.py`
- [Entity extraction](https://github.com/ahmednasser5/kemet-vision/blob/main/multimodal_router.py): `multimodal_router.py`
- [Entity session store](https://github.com/ahmednasser5/kemet-vision/blob/main/multimodal_router.py): `multimodal_router.py`
- **Artifact description**

### Other components

- **Artifact visitor**

## Connections

- Artifact visitor → Streamlit interface: submits photo (evidence: `README.md`)
- Streamlit interface → Image loading: loads image
- Image loading → Camera detection: checks source (evidence: `multimodal_router.py`)
- Camera detection → OOD similarity filter: selects threshold (evidence: `multimodal_router.py`)
- OOD similarity filter → EfficientNet classifier: accepts image (evidence: `multimodal_router.py`)
- EfficientNet classifier → CLIP verifiers: low confidence verifies (evidence: `README.md`)
- CLIP verifiers → Ensemble vote: casts votes (evidence: `README.md`)
- EfficientNet classifier → Ensemble vote: fallback prediction (evidence: `README.md`)
- EfficientNet classifier → Prediction results: returns prediction
- Ensemble vote → Prediction results: returns consensus (evidence: `README.md`)
- Prediction results → Artifact visitor: shows result
- Image loading → RAG query generation: generates query (evidence: `multimodal_router.py`)
- RAG query generation → Entity extraction: tracks entity (evidence: `multimodal_router.py`)
- Entity extraction → Entity session store: updates entity (evidence: `multimodal_router.py`)
- Artifact visitor → Artifact description: asks about artifact (evidence: `README.md`)
- EfficientNet classifier → Artifact description: provides class (evidence: `README.md`)
- Artifact description → Artifact visitor: returns description (evidence: `README.md`)
- Artifact visitor → Mobile application: uses app (evidence: `README.md`)
