# meyraj/bulk-image-upscaling-project architecture

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

- Interactive diagram: https://gitdiagram.com/meyraj/bulk-image-upscaling-project
- Repository: https://github.com/meyraj/bulk-image-upscaling-project

## Overview

The product is an image super-resolution application with batch and watched-folder entry points. Its main workflow discovers and validates images, loads selected model weights, performs single-model or ensemble inference, and saves upscaled results. The repository also includes channel, PSNR, and sharpness diagnostics. Edges reflect the sampled calls and explicit README descriptions; the diagnostics are separate from the production inference path.

Main entry points: [`image_upscaler/inference.py`](https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/inference.py) (Batch inference), [`image_upscaler/watch.py`](https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/watch.py) (Folder watcher), [`image_upscaler/src/model_loader.py`](https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/src/model_loader.py) (Model loading), [`verify_channels.py`](https://github.com/meyraj/bulk-image-upscaling-project/blob/main/verify_channels.py) (Channel verification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entrypoints["Processing entry points"]
  node_watcher["Folder watcher<br/>[watch.py]"]
  node_batch["Batch inference<br/>[inference.py]"]
end

subgraph group_processing["Image processing"]
  node_discovery["Image discovery<br/>[image_loader.py]"]
  node_single["Single upscaler<br/>[upscaler.py]"]
  node_ensemble["Ensemble upscaler<br/>[upscaler.py]"]
  node_model_loading["Model loading<br/>[model_loader.py]"]
end

subgraph group_runtime["Runtime support"]
  node_model_weights[("Model weights")]
  node_settings["Processing settings<br/>[config.py]"]
  node_logging["Application logging<br/>[logger.py]"]
  node_utilities["Directory and timing helpers<br/>[utils.py]"]
  node_input_images[("Input images")]
  node_output_images[("Upscaled images")]
  node_archive[("Processed archive")]
end

subgraph group_diagnostics["Quality diagnostics"]
  node_channel_check["Channel verification<br/>[verify_channels.py]"]
  node_diagnostic_images[("Comparison images")]
  node_psnr["PSNR comparison<br/>[check_psnr.py]"]
  node_sharpness["Sharpness analysis"]
end

node_user(("User"))

node_user -->|"runs batch"| node_batch
node_user -->|"starts watcher"| node_watcher
node_watcher -->|"launches inference"| node_batch
node_watcher -->|"scans files"| node_input_images
node_watcher -->|"moves processed"| node_archive
node_batch -->|"reads defaults"| node_settings
node_batch -->|"configures logging"| node_logging
node_batch -->|"creates directories"| node_utilities
node_batch -->|"scans and loads"| node_discovery
node_discovery -->|"reads formats"| node_settings
node_batch -->|"loads selected models"| node_model_loading
node_model_loading -->|"resolves model names"| node_settings
node_model_loading -->|"reads checkpoints"| node_model_weights
node_batch -->|"runs single model"| node_single
node_batch -->|"runs ensemble"| node_ensemble
node_single -->|"times inference"| node_utilities
node_ensemble -->|"times inference"| node_utilities
node_batch -->|"saves results"| node_output_images
node_user -->|"runs diagnostics"| node_channel_check
node_channel_check -->|"loads checkpoint"| node_model_weights
node_channel_check -->|"writes comparisons"| node_diagnostic_images
node_psnr -->|"reads comparisons"| node_diagnostic_images
node_sharpness -->|"reads comparisons"| node_diagnostic_images
node_user -->|"runs diagnostics"| node_psnr
node_user -->|"runs diagnostics"| node_sharpness

click node_watcher "https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/watch.py"
click node_batch "https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/inference.py"
click node_discovery "https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/src/image_loader.py"
click node_single "https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/src/upscaler.py"
click node_ensemble "https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/src/upscaler.py"
click node_model_loading "https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/src/model_loader.py"
click node_model_weights "https://github.com/meyraj/bulk-image-upscaling-project/tree/main/image_upscaler/models"
click node_settings "https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/src/config.py"
click node_logging "https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/src/logger.py"
click node_utilities "https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/src/utils.py"
click node_input_images "https://github.com/meyraj/bulk-image-upscaling-project/tree/main/image_upscaler/input"
click node_output_images "https://github.com/meyraj/bulk-image-upscaling-project/tree/main/image_upscaler/output"
click node_archive "https://github.com/meyraj/bulk-image-upscaling-project/tree/main/image_upscaler/input"
click node_channel_check "https://github.com/meyraj/bulk-image-upscaling-project/blob/main/verify_channels.py"
click node_psnr "https://github.com/meyraj/bulk-image-upscaling-project/blob/main/check_psnr.py"
click node_sharpness "https://github.com/meyraj/bulk-image-upscaling-project/blob/main/measure_sharpness.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_watcher,node_batch,node_user toneBlue
class node_discovery,node_single,node_ensemble,node_model_loading toneAmber
class node_model_weights,node_settings,node_logging,node_utilities,node_input_images,node_output_images,node_archive toneMint
class node_channel_check,node_diagnostic_images,node_psnr,node_sharpness toneRose
```

## Components

### Processing entry points

- [Folder watcher](https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/watch.py): `image_upscaler/watch.py`
- [Batch inference](https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/inference.py): `image_upscaler/inference.py`

### Image processing

- [Image discovery](https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/src/image_loader.py): `image_upscaler/src/image_loader.py`
- [Single upscaler](https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/src/upscaler.py): `image_upscaler/src/upscaler.py`
- [Ensemble upscaler](https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/src/upscaler.py): `image_upscaler/src/upscaler.py`
- [Model loading](https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/src/model_loader.py): `image_upscaler/src/model_loader.py`

### Runtime support

- [Model weights](https://github.com/meyraj/bulk-image-upscaling-project/tree/main/image_upscaler/models): `image_upscaler/models`
- [Processing settings](https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/src/config.py): `image_upscaler/src/config.py`
- [Application logging](https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/src/logger.py): `image_upscaler/src/logger.py`
- [Directory and timing helpers](https://github.com/meyraj/bulk-image-upscaling-project/blob/main/image_upscaler/src/utils.py): `image_upscaler/src/utils.py`
- [Input images](https://github.com/meyraj/bulk-image-upscaling-project/tree/main/image_upscaler/input): `image_upscaler/input`
- [Upscaled images](https://github.com/meyraj/bulk-image-upscaling-project/tree/main/image_upscaler/output): `image_upscaler/output`
- [Processed archive](https://github.com/meyraj/bulk-image-upscaling-project/tree/main/image_upscaler/input): `image_upscaler/input`

### Quality diagnostics

- [Channel verification](https://github.com/meyraj/bulk-image-upscaling-project/blob/main/verify_channels.py): `verify_channels.py`
- **Comparison images**
- [PSNR comparison](https://github.com/meyraj/bulk-image-upscaling-project/blob/main/check_psnr.py): `check_psnr.py`
- [Sharpness analysis](https://github.com/meyraj/bulk-image-upscaling-project/blob/main/measure_sharpness.py): `measure_sharpness.py`

### Other components

- **User**

## Connections

- User → Batch inference: runs batch (evidence: `README.md`)
- User → Folder watcher: starts watcher (evidence: `README.md`)
- Folder watcher → Batch inference: launches inference (evidence: `image_upscaler/watch.py`)
- Folder watcher → Input images: scans files (evidence: `image_upscaler/watch.py`)
- Folder watcher → Processed archive: moves processed (evidence: `image_upscaler/watch.py`)
- Batch inference → Processing settings: reads defaults (evidence: `image_upscaler/inference.py`)
- Batch inference → Application logging: configures logging (evidence: `image_upscaler/inference.py`)
- Batch inference → Directory and timing helpers: creates directories (evidence: `image_upscaler/inference.py`)
- Batch inference → Image discovery: scans and loads (evidence: `image_upscaler/inference.py`)
- Image discovery → Processing settings: reads formats (evidence: `image_upscaler/src/image_loader.py`)
- Batch inference → Model loading: loads selected models (evidence: `image_upscaler/inference.py`)
- Model loading → Processing settings: resolves model names (evidence: `image_upscaler/src/model_loader.py`)
- Model loading → Model weights: reads checkpoints (evidence: `image_upscaler/src/model_loader.py`)
- Batch inference → Single upscaler: runs single model (evidence: `image_upscaler/inference.py`)
- Batch inference → Ensemble upscaler: runs ensemble (evidence: `image_upscaler/inference.py`)
- Single upscaler → Directory and timing helpers: times inference (evidence: `image_upscaler/src/upscaler.py`)
- Ensemble upscaler → Directory and timing helpers: times inference (evidence: `image_upscaler/src/upscaler.py`)
- Batch inference → Upscaled images: saves results (evidence: `image_upscaler/inference.py`)
- User → Channel verification: runs diagnostics (evidence: `README.md`)
- Channel verification → Model weights: loads checkpoint (evidence: `verify_channels.py`)
- Channel verification → Comparison images: writes comparisons (evidence: `verify_channels.py`)
- PSNR comparison → Comparison images: reads comparisons (evidence: `check_psnr.py`)
- Sharpness analysis → Comparison images: reads comparisons (evidence: `measure_sharpness.py`)
- User → PSNR comparison: runs diagnostics (evidence: `README.md`)
- User → Sharpness analysis: runs diagnostics (evidence: `README.md`)
