# suryavamshikusam/resolv architecture

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

- Interactive diagram: https://gitdiagram.com/suryavamshikusam/resolv
- Repository: https://github.com/suryavamshikusam/resolv

## Overview

Resolv is a client-side 3× super-resolution studio and an accompanying model-training project. In the main user workflow, someone supplies an image, chooses a bicubic, SRCNN, or SRGAN result, and inspects side-by-side outputs and intermediate activations in the browser. Internally, separate training paths produce the two learned models, which are exported for browser inference. The README documents the interactive browser capabilities; unsampled `index.html` implementation details are not inferred beyond that documentation.

Main entry points: [`upscale.py`](https://github.com/suryavamshikusam/resolv/blob/main/upscale.py) (Image inference), [`train.py`](https://github.com/suryavamshikusam/resolv/blob/main/train.py) (SRCNN training), [`train_gan.py`](https://github.com/suryavamshikusam/resolv/blob/main/train_gan.py) (SRGAN training), [`data`](https://github.com/suryavamshikusam/resolv/tree/main/data) (Training and Set5 data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_studio["Browser studio"]
  node_ui["Interactive studio<br/>[index.html]"]
  node_browser_runtime["ONNX Runtime Web"]
end

subgraph group_inference["Inference models"]
  node_onnx_models["Browser model files"]
  node_inference_api["Image inference<br/>[upscale.py]"]
  node_network_architectures["SRCNN and SRGAN<br/>[model.py]"]
  node_checkpoint_weights["Trained weights"]
end

subgraph group_training["Training pipelines"]
  node_srcnn_training["SRCNN training<br/>[train.py]"]
  node_srgan_training["SRGAN training<br/>[train_gan.py]"]
  node_onnx_export["Browser model export<br/>[export_onnx.py]"]
end

subgraph group_data["Data and evaluation"]
  node_training_data[("Training and Set5 data")]
  node_dataset_download["Dataset downloads<br/>[download_data.py]"]
  node_shared_helpers["Image and metric helpers<br/>[utils.py]"]
  node_benchmark["Set5 comparison<br/>[benchmark.py]"]
end

node_user(("Image user"))

node_user -->|"uploads image"| node_ui
node_ui -->|"runs inference"| node_browser_runtime
node_browser_runtime -->|"loads models"| node_onnx_models
node_ui -->|"shows comparisons"| node_user
node_inference_api -->|"loads weights"| node_checkpoint_weights
node_inference_api -->|"constructs model"| node_network_architectures
node_inference_api -->|"uses helpers"| node_shared_helpers
node_srcnn_training -->|"trains SRCNN"| node_network_architectures
node_srgan_training -->|"trains SRGAN"| node_network_architectures
node_srcnn_training -->|"uses helpers"| node_shared_helpers
node_srgan_training -->|"uses helpers"| node_shared_helpers
node_srcnn_training -.->|"reads training data"| node_training_data
node_srgan_training -.->|"reads training data"| node_training_data
node_srcnn_training -.->|"saves weights"| node_checkpoint_weights
node_srgan_training -.->|"saves weights"| node_checkpoint_weights
node_onnx_export -->|"loads checkpoints"| node_inference_api
node_onnx_export -->|"exports models"| node_onnx_models
node_dataset_download -->|"downloads datasets"| node_training_data
node_benchmark -.->|"compares outputs"| node_inference_api
node_benchmark -.->|"uses Set5"| node_training_data

click node_ui "https://github.com/suryavamshikusam/resolv/blob/main/index.html"
click node_onnx_models "https://github.com/suryavamshikusam/resolv/tree/main/models"
click node_inference_api "https://github.com/suryavamshikusam/resolv/blob/main/upscale.py"
click node_network_architectures "https://github.com/suryavamshikusam/resolv/blob/main/model.py"
click node_checkpoint_weights "https://github.com/suryavamshikusam/resolv/tree/main/checkpoints"
click node_training_data "https://github.com/suryavamshikusam/resolv/tree/main/data"
click node_dataset_download "https://github.com/suryavamshikusam/resolv/blob/main/download_data.py"
click node_shared_helpers "https://github.com/suryavamshikusam/resolv/blob/main/utils.py"
click node_srcnn_training "https://github.com/suryavamshikusam/resolv/blob/main/train.py"
click node_srgan_training "https://github.com/suryavamshikusam/resolv/blob/main/train_gan.py"
click node_onnx_export "https://github.com/suryavamshikusam/resolv/blob/main/export_onnx.py"
click node_benchmark "https://github.com/suryavamshikusam/resolv/blob/main/benchmark.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_runtime,node_user toneBlue
class node_onnx_models,node_inference_api,node_network_architectures,node_checkpoint_weights toneAmber
class node_srcnn_training,node_srgan_training,node_onnx_export toneMint
class node_training_data,node_dataset_download,node_shared_helpers,node_benchmark toneRose
```

## Components

### Browser studio

- [Interactive studio](https://github.com/suryavamshikusam/resolv/blob/main/index.html): `index.html`
- **ONNX Runtime Web**

### Inference models

- [Browser model files](https://github.com/suryavamshikusam/resolv/tree/main/models): `models`
- [Image inference](https://github.com/suryavamshikusam/resolv/blob/main/upscale.py): `upscale.py`
- [SRCNN and SRGAN](https://github.com/suryavamshikusam/resolv/blob/main/model.py): `model.py`
- [Trained weights](https://github.com/suryavamshikusam/resolv/tree/main/checkpoints): `checkpoints`

### Training pipelines

- [SRCNN training](https://github.com/suryavamshikusam/resolv/blob/main/train.py): `train.py`
- [SRGAN training](https://github.com/suryavamshikusam/resolv/blob/main/train_gan.py): `train_gan.py`
- [Browser model export](https://github.com/suryavamshikusam/resolv/blob/main/export_onnx.py): `export_onnx.py`

### Data and evaluation

- [Training and Set5 data](https://github.com/suryavamshikusam/resolv/tree/main/data): `data`
- [Dataset downloads](https://github.com/suryavamshikusam/resolv/blob/main/download_data.py): `download_data.py`
- [Image and metric helpers](https://github.com/suryavamshikusam/resolv/blob/main/utils.py): `utils.py`
- [Set5 comparison](https://github.com/suryavamshikusam/resolv/blob/main/benchmark.py): `benchmark.py`

### Other components

- **Image user**

## Connections

- Image user → Interactive studio: uploads image (evidence: `README.md`)
- Interactive studio → ONNX Runtime Web: runs inference (evidence: `README.md`)
- ONNX Runtime Web → Browser model files: loads models (evidence: `README.md`)
- Interactive studio → Image user: shows comparisons (evidence: `README.md`)
- Image inference → Trained weights: loads weights (evidence: `upscale.py`)
- Image inference → SRCNN and SRGAN: constructs model (evidence: `upscale.py`)
- Image inference → Image and metric helpers: uses helpers (evidence: `upscale.py`)
- SRCNN training → SRCNN and SRGAN: trains SRCNN (evidence: `train.py`)
- SRGAN training → SRCNN and SRGAN: trains SRGAN (evidence: `train_gan.py`)
- SRCNN training → Image and metric helpers: uses helpers (evidence: `train.py`)
- SRGAN training → Image and metric helpers: uses helpers (evidence: `train_gan.py`)
- SRCNN training → Training and Set5 data: reads training data
- SRGAN training → Training and Set5 data: reads training data
- SRCNN training → Trained weights: saves weights
- SRGAN training → Trained weights: saves weights
- Browser model export → Image inference: loads checkpoints (evidence: `export_onnx.py`)
- Browser model export → Browser model files: exports models (evidence: `export_onnx.py`)
- Dataset downloads → Training and Set5 data: downloads datasets (evidence: `download_data.py`)
- Set5 comparison → Image inference: compares outputs
- Set5 comparison → Training and Set5 data: uses Set5
