# ipsita675/visionai architecture

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

- Interactive diagram: https://gitdiagram.com/ipsita675/visionai
- Repository: https://github.com/ipsita675/visionai

## Overview

VisionAI lets a user upload an image, receive a caption and object detections, inspect the results, and ask image-specific questions; accessibility mode can narrate results in the browser. The frontend page coordinates analysis requests and presentation, while the FastAPI routes validate uploads and invoke separate inference services. The README documents additional UI and API capabilities. Some frontend wiring and the response schema were not excerpted, so those relationships are shown only where supported by excerpts or README statements.

Main entry points: [`backend/app/main.py`](https://github.com/ipsita675/visionai/blob/main/backend/app/main.py) (Analysis API routes), [`frontend/app/page.tsx`](https://github.com/ipsita675/visionai/blob/main/frontend/app/page.tsx) (Application page), [`frontend/components/VQASection.tsx`](https://github.com/ipsita675/visionai/blob/main/frontend/components/VQASection.tsx) (Question interface), [`frontend/components/UploadCard.tsx`](https://github.com/ipsita675/visionai/blob/main/frontend/components/UploadCard.tsx) (Upload control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_page["Application page<br/>[page.tsx]"]
  node_upload["Upload control<br/>[UploadCard.tsx]"]
  node_viewer["Image and detections<br/>[ImageViewer.tsx]"]
  node_vqa_ui["Question interface<br/>[VQASection.tsx]"]
end

subgraph group_api["API and validation"]
  node_api_routes["Analysis API routes<br/>[main.py]"]
  node_image_validation["Image validation<br/>[image_utils.py]"]
end

subgraph group_analysis["Image inference"]
  node_captioning["BLIP captioning<br/>[captioner.py]"]
  node_detection["YOLO detection<br/>[detector.py]"]
  node_vqa_model["BLIP visual QA<br/>[vqa.py]"]
end

subgraph group_support["Runtime support"]
  node_timing["Stage timing<br/>[timer.py]"]
end

node_user(("Image analyst"))
node_speech["Browser speech"]

node_user -->|"selects image"| node_upload
node_upload -.->|"passes file"| node_page
node_page -->|"posts analysis"| node_api_routes
node_api_routes -->|"validates upload"| node_image_validation
node_api_routes -->|"requests caption"| node_captioning
node_api_routes -->|"requests detections"| node_detection
node_api_routes -->|"measures stages"| node_timing
node_api_routes -->|"validates question image"| node_image_validation
node_api_routes -->|"requests answer"| node_vqa_model
node_page -->|"renders analysis"| node_viewer
node_page -->|"renders questions"| node_vqa_ui
node_vqa_ui -->|"posts question"| node_api_routes
node_page -->|"narrates results"| node_speech
node_vqa_ui -->|"speaks answers"| node_speech

click node_page "https://github.com/ipsita675/visionai/blob/main/frontend/app/page.tsx"
click node_upload "https://github.com/ipsita675/visionai/blob/main/frontend/components/UploadCard.tsx"
click node_viewer "https://github.com/ipsita675/visionai/blob/main/frontend/components/ImageViewer.tsx"
click node_vqa_ui "https://github.com/ipsita675/visionai/blob/main/frontend/components/VQASection.tsx"
click node_api_routes "https://github.com/ipsita675/visionai/blob/main/backend/app/main.py"
click node_image_validation "https://github.com/ipsita675/visionai/blob/main/backend/app/utils/image_utils.py"
click node_captioning "https://github.com/ipsita675/visionai/blob/main/backend/app/services/captioner.py"
click node_detection "https://github.com/ipsita675/visionai/blob/main/backend/app/services/detector.py"
click node_vqa_model "https://github.com/ipsita675/visionai/blob/main/backend/app/services/vqa.py"
click node_timing "https://github.com/ipsita675/visionai/blob/main/backend/app/utils/timer.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_page,node_upload,node_viewer,node_vqa_ui,node_speech toneBlue
class node_api_routes,node_image_validation toneAmber
class node_captioning,node_detection,node_vqa_model toneMint
class node_timing toneRose
class node_user toneIndigo
```

## Components

### Web interface

- [Application page](https://github.com/ipsita675/visionai/blob/main/frontend/app/page.tsx): `frontend/app/page.tsx`
- [Upload control](https://github.com/ipsita675/visionai/blob/main/frontend/components/UploadCard.tsx): `frontend/components/UploadCard.tsx`
- [Image and detections](https://github.com/ipsita675/visionai/blob/main/frontend/components/ImageViewer.tsx): `frontend/components/ImageViewer.tsx`
- [Question interface](https://github.com/ipsita675/visionai/blob/main/frontend/components/VQASection.tsx): `frontend/components/VQASection.tsx`

### API and validation

- [Analysis API routes](https://github.com/ipsita675/visionai/blob/main/backend/app/main.py): `backend/app/main.py`
- [Image validation](https://github.com/ipsita675/visionai/blob/main/backend/app/utils/image_utils.py): `backend/app/utils/image_utils.py`

### Image inference

- [BLIP captioning](https://github.com/ipsita675/visionai/blob/main/backend/app/services/captioner.py): `backend/app/services/captioner.py`
- [YOLO detection](https://github.com/ipsita675/visionai/blob/main/backend/app/services/detector.py): `backend/app/services/detector.py`
- [BLIP visual QA](https://github.com/ipsita675/visionai/blob/main/backend/app/services/vqa.py): `backend/app/services/vqa.py`

### Runtime support

- [Stage timing](https://github.com/ipsita675/visionai/blob/main/backend/app/utils/timer.py): `backend/app/utils/timer.py`

### Other components

- **Image analyst**
- **Browser speech**

## Connections

- Image analyst → Upload control: selects image (evidence: `README.md`)
- Upload control → Application page: passes file
- Application page → Analysis API routes: posts analysis (evidence: `frontend/app/page.tsx`)
- Analysis API routes → Image validation: validates upload (evidence: `backend/app/main.py`)
- Analysis API routes → BLIP captioning: requests caption (evidence: `backend/app/main.py`)
- Analysis API routes → YOLO detection: requests detections (evidence: `backend/app/main.py`)
- Analysis API routes → Stage timing: measures stages (evidence: `backend/app/main.py`)
- Analysis API routes → Image validation: validates question image (evidence: `backend/app/main.py`)
- Analysis API routes → BLIP visual QA: requests answer (evidence: `backend/app/main.py`)
- Application page → Image and detections: renders analysis (evidence: `README.md`)
- Application page → Question interface: renders questions (evidence: `README.md`)
- Question interface → Analysis API routes: posts question (evidence: `frontend/components/VQASection.tsx`)
- Application page → Browser speech: narrates results (evidence: `frontend/app/page.tsx`)
- Question interface → Browser speech: speaks answers (evidence: `frontend/components/VQASection.tsx`)
