# bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery architecture

> Architecture diagram of the GitHub repository bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery
- Repository: https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery

## Overview

TerraQuery is a satellite-imagery interpretation system: users submit an image and natural-language question, and the application presents an answer with supporting visual analysis. The documented VQA workflow extracts object classes, detects and segments image regions, computes geometric properties, then uses a vision-language model to answer. The repository also contains a separate GroundingDINO/SAM/Groq orchestration variant. API wiring is not visible in the excerpts, so those links are marked unverified; the README provides no further implementation detail.

Main entry points: [`Team_27/vqa/orchestrator.py`](https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/Team_27/vqa/orchestrator.py) (VQA orchestrator), [`code/Grounded-Segment-Anything/vqa/orchestrator.py`](https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/code/Grounded-Segment-Anything/vqa/orchestrator.py) (Grounded VQA variant), [`Team_27/frontend/src/App.jsx`](https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/Team_27/frontend/src/App.jsx) (Web interface), [`Team_27/backend/api.py`](https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/Team_27/backend/api.py) (HTTP backend)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_ui["Web interface<br/>[App.jsx]"]
  node_backend["HTTP backend<br/>[api.py]"]
  node_unified_api["Unified VQA API<br/>[unified_api.py]"]
end

subgraph group_workflow["Image question workflow"]
  node_orchestrator["VQA orchestrator<br/>[orchestrator.py]"]
  node_gsam_orchestrator["Grounded VQA variant<br/>[orchestrator.py]"]
end

subgraph group_analysis["Image analysis"]
  node_classifier["Image type classifier"]
  node_grounding["Object grounding<br/>[orchestrator.py]"]
  node_mask_merge["Mask merging<br/>[mask_merging.py]"]
  node_geometry["Mask geometry<br/>[geometric_utils.py]"]
end

subgraph group_integrations["Model integrations"]
  node_sam_client["SAM3 client<br/>[sam3_api.py]"]
  node_sam_service["SAM3 service<br/>[api.py]"]
  node_vlm["Local vision-language model<br/>[local_vlm.py]"]
  node_gsam["Grounded segmentation<br/>[gsam.py]"]
  node_groq["Groq text service<br/>[groq_client.py]"]
end

node_user(("Imagery analyst"))

node_user -->|"submits image and question"| node_ui
node_ui -.->|"sends analysis request"| node_backend
node_backend -.->|"routes request"| node_unified_api
node_unified_api -.->|"dispatches analysis"| node_orchestrator
node_orchestrator -->|"classifies image"| node_classifier
node_orchestrator -->|"finds objects"| node_grounding
node_orchestrator -->|"requests masks"| node_sam_client
node_sam_client -.->|"sends segmentation request"| node_sam_service
node_orchestrator -->|"merges masks"| node_mask_merge
node_orchestrator -->|"computes properties"| node_geometry
node_orchestrator -->|"answers question"| node_vlm
node_gsam_orchestrator -->|"segments detections"| node_gsam
node_gsam_orchestrator -->|"asks crop question"| node_vlm
node_gsam_orchestrator -->|"generates and synthesizes text"| node_groq

click node_ui "https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/Team_27/frontend/src/App.jsx"
click node_backend "https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/Team_27/backend/api.py"
click node_unified_api "https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/Team_27/vqa/unified_api.py"
click node_orchestrator "https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/Team_27/vqa/orchestrator.py"
click node_classifier "https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/vqa/image_type_classifier.py"
click node_grounding "https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/Team_27/vqa/orchestrator.py"
click node_sam_client "https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/Team_27/vqa/sam3_api.py"
click node_sam_service "https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/Team_27/sam3/api.py"
click node_mask_merge "https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/vqa/mask_merging.py"
click node_geometry "https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/vqa/geometric_utils.py"
click node_vlm "https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/vqa/local_vlm.py"
click node_gsam_orchestrator "https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/code/Grounded-Segment-Anything/vqa/orchestrator.py"
click node_gsam "https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/vqa/gsam.py"
click node_groq "https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/vqa/groq_client.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_backend,node_unified_api toneBlue
class node_orchestrator,node_gsam_orchestrator toneAmber
class node_classifier,node_grounding,node_mask_merge,node_geometry toneMint
class node_sam_client,node_sam_service,node_vlm,node_gsam,node_groq toneRose
class node_user toneIndigo
```

## Components

### User experience

- [Web interface](https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/Team_27/frontend/src/App.jsx): `Team_27/frontend/src/App.jsx`
- [HTTP backend](https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/Team_27/backend/api.py): `Team_27/backend/api.py`
- [Unified VQA API](https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/Team_27/vqa/unified_api.py): `Team_27/vqa/unified_api.py`

### Image question workflow

- [VQA orchestrator](https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/Team_27/vqa/orchestrator.py): `Team_27/vqa/orchestrator.py`
- [Grounded VQA variant](https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/code/Grounded-Segment-Anything/vqa/orchestrator.py): `code/Grounded-Segment-Anything/vqa/orchestrator.py`

### Image analysis

- [Image type classifier](https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/vqa/image_type_classifier.py): `vqa/image_type_classifier.py`
- [Object grounding](https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/Team_27/vqa/orchestrator.py): `Team_27/vqa/orchestrator.py`
- [Mask merging](https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/vqa/mask_merging.py): `vqa/mask_merging.py`
- [Mask geometry](https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/vqa/geometric_utils.py): `vqa/geometric_utils.py`

### Model integrations

- [SAM3 client](https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/Team_27/vqa/sam3_api.py): `Team_27/vqa/sam3_api.py`
- [SAM3 service](https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/Team_27/sam3/api.py): `Team_27/sam3/api.py`
- [Local vision-language model](https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/vqa/local_vlm.py): `vqa/local_vlm.py`
- [Grounded segmentation](https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/vqa/gsam.py): `vqa/gsam.py`
- [Groq text service](https://github.com/bansal-yash/terraquery-natural-language-interpretation-of-satellite-imagery/blob/main/vqa/groq_client.py): `vqa/groq_client.py`

### Other components

- **Imagery analyst**

## Connections

- Imagery analyst → Web interface: submits image and question (evidence: `Team_27/frontend/src/App.jsx`)
- Web interface → HTTP backend: sends analysis request
- HTTP backend → Unified VQA API: routes request
- Unified VQA API → VQA orchestrator: dispatches analysis
- VQA orchestrator → Image type classifier: classifies image (evidence: `Team_27/vqa/orchestrator.py`)
- VQA orchestrator → Object grounding: finds objects (evidence: `Team_27/vqa/orchestrator.py`)
- VQA orchestrator → SAM3 client: requests masks (evidence: `Team_27/vqa/orchestrator.py`)
- SAM3 client → SAM3 service: sends segmentation request
- VQA orchestrator → Mask merging: merges masks (evidence: `Team_27/vqa/orchestrator.py`)
- VQA orchestrator → Mask geometry: computes properties (evidence: `Team_27/vqa/orchestrator.py`)
- VQA orchestrator → Local vision-language model: answers question (evidence: `Team_27/vqa/orchestrator.py`)
- Grounded VQA variant → Grounded segmentation: segments detections (evidence: `code/Grounded-Segment-Anything/vqa/orchestrator.py`)
- Grounded VQA variant → Local vision-language model: asks crop question (evidence: `code/Grounded-Segment-Anything/vqa/orchestrator.py`)
- Grounded VQA variant → Groq text service: generates and synthesizes text (evidence: `code/Grounded-Segment-Anything/vqa/orchestrator.py`)
