# albinvsoju/smart-grade-omr architecture

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

- Interactive diagram: https://gitdiagram.com/albinvsoju/smart-grade-omr
- Repository: https://github.com/albinvsoju/smart-grade-omr

## Overview

SmartGrade is a browser-based OMR grading tool: a user supplies a marked answer-sheet image and answer key, the Flask endpoint validates and parses the request, and the OMR processor detects marks, compares answers, and returns a score plus an annotated image. The sampled backend confirms the processing and result-writing steps. The HTML file is present in the tree but was not sampled, so its interaction with the endpoint is not verified; the route’s requested filename also differs in case from the listed file.

Main entry points: [`app.py`](https://github.com/albinvsoju/smart-grade-omr/blob/main/app.py) (Upload and grade API), [`SmartGrade OMR.html`](https://github.com/albinvsoju/smart-grade-omr/blob/main/SmartGrade%20OMR.html) (Grading page), [`omr.py`](https://github.com/albinvsoju/smart-grade-omr/blob/main/omr.py) (Image decoding), [`static`](https://github.com/albinvsoju/smart-grade-omr/blob/main/static) (Annotated result image)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_frontend["Grading page"]
end

subgraph group_service["Grading service"]
  node_api["Upload and grade API<br/>[app.py]"]
end

subgraph group_processing["OMR processing"]
  node_decode["Image decoding<br/>[omr.py]"]
  node_detect["Bubble detection<br/>[omr.py]"]
  node_grade["Answer grading<br/>[omr.py]"]
  node_result["Annotated result image"]
end

node_user(("User"))

node_user -.->|"uses"| node_frontend
node_frontend -.->|"submits sheet"| node_api
node_api -->|"calls processor"| node_decode
node_decode -->|"prepares image"| node_detect
node_detect -->|"provides marks"| node_grade
node_grade -->|"writes image"| node_result
node_api -->|"serves page"| node_frontend

click node_frontend "https://github.com/albinvsoju/smart-grade-omr/blob/main/SmartGrade%20OMR.html"
click node_api "https://github.com/albinvsoju/smart-grade-omr/blob/main/app.py"
click node_decode "https://github.com/albinvsoju/smart-grade-omr/blob/main/omr.py"
click node_detect "https://github.com/albinvsoju/smart-grade-omr/blob/main/omr.py"
click node_grade "https://github.com/albinvsoju/smart-grade-omr/blob/main/omr.py"
click node_result "https://github.com/albinvsoju/smart-grade-omr/blob/main/static"

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_frontend,node_user toneBlue
class node_api toneAmber
class node_decode,node_detect,node_grade,node_result toneMint
```

## Components

### User interface

- [Grading page](https://github.com/albinvsoju/smart-grade-omr/blob/main/SmartGrade%20OMR.html): `SmartGrade OMR.html`

### Grading service

- [Upload and grade API](https://github.com/albinvsoju/smart-grade-omr/blob/main/app.py): `app.py`

### OMR processing

- [Image decoding](https://github.com/albinvsoju/smart-grade-omr/blob/main/omr.py): `omr.py`
- [Bubble detection](https://github.com/albinvsoju/smart-grade-omr/blob/main/omr.py): `omr.py`
- [Answer grading](https://github.com/albinvsoju/smart-grade-omr/blob/main/omr.py): `omr.py`
- [Annotated result image](https://github.com/albinvsoju/smart-grade-omr/blob/main/static): `static`

### Other components

- **User**

## Connections

- User → Grading page: uses
- Grading page → Upload and grade API: submits sheet
- Upload and grade API → Image decoding: calls processor (evidence: `app.py`)
- Image decoding → Bubble detection: prepares image (evidence: `omr.py`)
- Bubble detection → Answer grading: provides marks (evidence: `omr.py`)
- Answer grading → Annotated result image: writes image (evidence: `omr.py`)
- Upload and grade API → Grading page: serves page (evidence: `app.py`)
