# brundha200/vision_ocr architecture

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

- Interactive diagram: https://gitdiagram.com/brundha200/vision_ocr
- Repository: https://github.com/brundha200/vision_ocr

## Overview

QwenVL Platform is a web app for document-image extraction, visual Q&A, audio transcription, and video-to-text processing. Users sign in, then submit media through the browser interface; Flask handles requests and returns results for display or export. Image tasks use the Qwen vision-language model, while video processing can combine Whisper speech transcription with sampled-frame OCR. The excerpts establish the backend model calls and one browser-to-backend request; some frontend request wiring and page contents were not sampled, so those links are omitted.

Main entry points: [`app.py`](https://github.com/brundha200/vision_ocr/blob/main/app.py) (Session access), [`qwen_model.py`](https://github.com/brundha200/vision_ocr/blob/main/qwen_model.py) (Qwen vision model), [`index.html`](https://github.com/brundha200/vision_ocr/blob/main/index.html) (Platform UI), [`script.js`](https://github.com/brundha200/vision_ocr/blob/main/script.js) (UI interactions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_ui["Platform UI<br/>[index.html]"]
  node_browser["UI interactions<br/>[script.js]"]
  node_login_page["Login page<br/>[login.html]"]
end

subgraph group_service["Flask service"]
  node_auth["Session access<br/>[app.py]"]
  node_image_extract["Image extraction<br/>[app.py]"]
  node_visual_qa["Visual Q&amp;A<br/>[app.py]"]
  node_audio_transcribe["Audio transcription<br/>[app.py]"]
  node_video_process["Video processing<br/>[app.py]"]
end

subgraph group_inference["Media inference"]
  node_vision_model["Qwen vision model<br/>[qwen_model.py]"]
  node_whisper["Whisper handler<br/>[qwen_model.py]"]
end

node_user(("User"))
node_ffmpeg["FFmpeg"]

node_user -->|"uses"| node_ui
node_user -->|"signs in"| node_auth
node_auth -->|"renders"| node_login_page
node_auth -->|"renders"| node_ui
node_browser -->|"posts question"| node_auth
node_image_extract -->|"extracts text"| node_vision_model
node_visual_qa -->|"asks image"| node_vision_model
node_video_process -->|"extracts audio"| node_ffmpeg
node_video_process -->|"transcribes speech"| node_whisper
node_video_process -->|"reads sampled frames"| node_vision_model

click node_ui "https://github.com/brundha200/vision_ocr/blob/main/index.html"
click node_browser "https://github.com/brundha200/vision_ocr/blob/main/script.js"
click node_login_page "https://github.com/brundha200/vision_ocr/blob/main/login.html"
click node_auth "https://github.com/brundha200/vision_ocr/blob/main/app.py"
click node_image_extract "https://github.com/brundha200/vision_ocr/blob/main/app.py"
click node_visual_qa "https://github.com/brundha200/vision_ocr/blob/main/app.py"
click node_audio_transcribe "https://github.com/brundha200/vision_ocr/blob/main/app.py"
click node_video_process "https://github.com/brundha200/vision_ocr/blob/main/app.py"
click node_vision_model "https://github.com/brundha200/vision_ocr/blob/main/qwen_model.py"
click node_whisper "https://github.com/brundha200/vision_ocr/blob/main/qwen_model.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_browser,node_login_page,node_user toneBlue
class node_auth,node_image_extract,node_visual_qa,node_audio_transcribe,node_video_process toneAmber
class node_vision_model,node_whisper toneMint
class node_ffmpeg toneIndigo
```

## Components

### Web interface

- [Platform UI](https://github.com/brundha200/vision_ocr/blob/main/index.html): `index.html`
- [UI interactions](https://github.com/brundha200/vision_ocr/blob/main/script.js): `script.js`
- [Login page](https://github.com/brundha200/vision_ocr/blob/main/login.html): `login.html`

### Flask service

- [Session access](https://github.com/brundha200/vision_ocr/blob/main/app.py): `app.py`
- [Image extraction](https://github.com/brundha200/vision_ocr/blob/main/app.py): `app.py`
- [Visual Q&A](https://github.com/brundha200/vision_ocr/blob/main/app.py): `app.py`
- [Audio transcription](https://github.com/brundha200/vision_ocr/blob/main/app.py): `app.py`
- [Video processing](https://github.com/brundha200/vision_ocr/blob/main/app.py): `app.py`

### Media inference

- [Qwen vision model](https://github.com/brundha200/vision_ocr/blob/main/qwen_model.py): `qwen_model.py`
- [Whisper handler](https://github.com/brundha200/vision_ocr/blob/main/qwen_model.py): `qwen_model.py`

### Other components

- **User**
- **FFmpeg**

## Connections

- User → Platform UI: uses
- User → Session access: signs in (evidence: `app.py`)
- Session access → Login page: renders (evidence: `app.py`)
- Session access → Platform UI: renders (evidence: `app.py`)
- UI interactions → Session access: posts question (evidence: `script.js`)
- Image extraction → Qwen vision model: extracts text (evidence: `app.py`)
- Visual Q&A → Qwen vision model: asks image (evidence: `app.py`)
- Video processing → FFmpeg: extracts audio (evidence: `app.py`)
- Video processing → Whisper handler: transcribes speech (evidence: `app.py`)
- Video processing → Qwen vision model: reads sampled frames (evidence: `app.py`)
