# gamerdox/sr-mapping architecture

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

- Interactive diagram: https://gitdiagram.com/gamerdox/sr-mapping
- Repository: https://github.com/gamerdox/sr-mapping

## Overview

Sentinel-2 Satellite Super-Resolution Studio is a CPU-oriented imagery enhancement service with an interactive Web GIS. Its main workflow accepts an uploaded image or coordinates, selects a super-resolution model, optionally runs test-time augmentation, and returns an enhanced image with uncertainty information. The backend also serves model discovery and health endpoints and can retrieve map tiles with an offline cache. The README documents additional deployment tiers, cascaded scaling, and spectral products; their implementation details are not established by the sampled source, so those links are shown as unverified or omitted.

Main entry points: [`backend/main.py`](https://github.com/gamerdox/sr-mapping/blob/main/backend/main.py) (API and orchestration), [`src/data/dataset.py`](https://github.com/gamerdox/sr-mapping/blob/main/src/data/dataset.py) (Paired image dataset), [`frontend/app.js`](https://github.com/gamerdox/sr-mapping/blob/main/frontend/app.js) (Web interface), [`src/models/sr_model.py`](https://github.com/gamerdox/sr-mapping/blob/main/src/models/sr_model.py) (Sentinel2SRNet)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web GIS"]
  node_web["Web interface<br/>[app.js]"]
  node_result["Enhanced image and uncertainty"]
  node_spectral["Spectral proxies"]
  node_cascade["Cascaded 2.5m output"]
end

subgraph group_service["Serving"]
  node_api["API and orchestration<br/>[main.py]"]
  node_tile_cache[("Offline tile cache")]
end

subgraph group_models["Super-resolution Models"]
  node_student["Sentinel2SRNet<br/>[sr_model.py]"]
  node_edsr["EDSR<br/>[edsr.py]"]
  node_eesrgan["EESRGAN<br/>[eesrgan.py]"]
  node_espcn["ESPCN<br/>[espcn.py]"]
  node_fsrcnn["FSRCNN<br/>[fsrcnn.py]"]
  node_slimdiffsr["SlimDiffSR<br/>[slimdiffsr.py]"]
  node_swin2["Swin2-MoSE<br/>[swin2_mose.py]"]
end

subgraph group_data["Imagery and Evaluation"]
  node_dataset["Paired image dataset<br/>[dataset.py]"]
  node_metrics["Image metrics<br/>[metrics.py]"]
end

node_analyst(("Analyst"))
node_tile_provider["Map tile service"]

node_analyst -->|"uses"| node_web
node_analyst -->|"requests inference"| node_api
node_api -->|"serves interface"| node_web
node_api -->|"fetches tiles"| node_tile_provider
node_api -->|"caches tiles"| node_tile_cache
node_api -->|"builds and runs"| node_student
node_api -->|"builds model"| node_edsr
node_api -->|"builds model"| node_eesrgan
node_api -->|"builds model"| node_espcn
node_api -->|"builds model"| node_fsrcnn
node_api -->|"builds model"| node_slimdiffsr
node_api -->|"builds model"| node_swin2
node_api -->|"returns prediction"| node_result
node_api -->|"estimates uncertainty"| node_result
node_dataset -.->|"trains from pairs"| node_student
node_dataset -.->|"trains from pairs"| node_edsr
node_dataset -.->|"trains from pairs"| node_eesrgan
node_dataset -.->|"evaluates against"| node_metrics
node_result -.->|"derives proxies"| node_spectral
node_result -.->|"may upscale again"| node_cascade

click node_web "https://github.com/gamerdox/sr-mapping/blob/main/frontend/app.js"
click node_api "https://github.com/gamerdox/sr-mapping/blob/main/backend/main.py"
click node_tile_cache "https://github.com/gamerdox/sr-mapping/tree/main/data/offline_tiles"
click node_dataset "https://github.com/gamerdox/sr-mapping/blob/main/src/data/dataset.py"
click node_student "https://github.com/gamerdox/sr-mapping/blob/main/src/models/sr_model.py"
click node_edsr "https://github.com/gamerdox/sr-mapping/blob/main/src/models/edsr.py"
click node_eesrgan "https://github.com/gamerdox/sr-mapping/blob/main/src/models/eesrgan.py"
click node_espcn "https://github.com/gamerdox/sr-mapping/blob/main/src/models/espcn.py"
click node_fsrcnn "https://github.com/gamerdox/sr-mapping/blob/main/src/models/fsrcnn.py"
click node_slimdiffsr "https://github.com/gamerdox/sr-mapping/blob/main/src/models/slimdiffsr.py"
click node_swin2 "https://github.com/gamerdox/sr-mapping/blob/main/src/models/swin2_mose.py"
click node_metrics "https://github.com/gamerdox/sr-mapping/blob/main/src/models/metrics.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_web,node_result,node_spectral,node_cascade toneBlue
class node_api,node_tile_cache toneAmber
class node_student,node_edsr,node_eesrgan,node_espcn,node_fsrcnn,node_slimdiffsr,node_swin2 toneMint
class node_dataset,node_metrics toneRose
class node_analyst,node_tile_provider toneIndigo
```

## Components

### Web GIS

- [Web interface](https://github.com/gamerdox/sr-mapping/blob/main/frontend/app.js): `frontend/app.js`
- **Enhanced image and uncertainty**
- **Spectral proxies**
- **Cascaded 2.5m output**

### Serving

- [API and orchestration](https://github.com/gamerdox/sr-mapping/blob/main/backend/main.py): `backend/main.py`
- [Offline tile cache](https://github.com/gamerdox/sr-mapping/tree/main/data/offline_tiles): `data/offline_tiles`

### Super-resolution Models

- [Sentinel2SRNet](https://github.com/gamerdox/sr-mapping/blob/main/src/models/sr_model.py): `src/models/sr_model.py`
- [EDSR](https://github.com/gamerdox/sr-mapping/blob/main/src/models/edsr.py): `src/models/edsr.py`
- [EESRGAN](https://github.com/gamerdox/sr-mapping/blob/main/src/models/eesrgan.py): `src/models/eesrgan.py`
- [ESPCN](https://github.com/gamerdox/sr-mapping/blob/main/src/models/espcn.py): `src/models/espcn.py`
- [FSRCNN](https://github.com/gamerdox/sr-mapping/blob/main/src/models/fsrcnn.py): `src/models/fsrcnn.py`
- [SlimDiffSR](https://github.com/gamerdox/sr-mapping/blob/main/src/models/slimdiffsr.py): `src/models/slimdiffsr.py`
- [Swin2-MoSE](https://github.com/gamerdox/sr-mapping/blob/main/src/models/swin2_mose.py): `src/models/swin2_mose.py`

### Imagery and Evaluation

- [Paired image dataset](https://github.com/gamerdox/sr-mapping/blob/main/src/data/dataset.py): `src/data/dataset.py`
- [Image metrics](https://github.com/gamerdox/sr-mapping/blob/main/src/models/metrics.py): `src/models/metrics.py`

### Other components

- **Analyst**
- **Map tile service**

## Connections

- Analyst → Web interface: uses (evidence: `README.md`)
- Analyst → API and orchestration: requests inference (evidence: `README.md`)
- API and orchestration → Web interface: serves interface (evidence: `backend/main.py`)
- API and orchestration → Map tile service: fetches tiles (evidence: `backend/main.py`)
- API and orchestration → Offline tile cache: caches tiles (evidence: `backend/main.py`)
- API and orchestration → Sentinel2SRNet: builds and runs (evidence: `backend/main.py`)
- API and orchestration → EDSR: builds model (evidence: `backend/main.py`)
- API and orchestration → EESRGAN: builds model (evidence: `backend/main.py`)
- API and orchestration → ESPCN: builds model (evidence: `backend/main.py`)
- API and orchestration → FSRCNN: builds model (evidence: `backend/main.py`)
- API and orchestration → SlimDiffSR: builds model (evidence: `backend/main.py`)
- API and orchestration → Swin2-MoSE: builds model (evidence: `backend/main.py`)
- API and orchestration → Enhanced image and uncertainty: returns prediction (evidence: `backend/main.py`)
- API and orchestration → Enhanced image and uncertainty: estimates uncertainty (evidence: `backend/main.py`)
- Paired image dataset → Sentinel2SRNet: trains from pairs (evidence: `README.md`)
- Paired image dataset → EDSR: trains from pairs (evidence: `README.md`)
- Paired image dataset → EESRGAN: trains from pairs (evidence: `README.md`)
- Paired image dataset → Image metrics: evaluates against (evidence: `README.md`)
- Enhanced image and uncertainty → Spectral proxies: derives proxies (evidence: `README.md`)
- Enhanced image and uncertainty → Cascaded 2.5m output: may upscale again (evidence: `README.md`)
