How va1shn9v/promptir works
PromptIR is a research codebase for all-in-one blind image restoration: it trains a prompt-guided network across denoising, deraining, and dehazing, then applies it to degraded images for evaluation or visual output. The principal training workflow builds degradation-labelled image patches, trains the network against clean patches, and saves checkpoints. Inference accepts images, runs the model (optionally by tiles), and saves restored images; testing also supports task-specific evaluation. Some links reflect README-documented behavior because test.py and parts of the dataset and model implementations were not sampled.
Main entry points: train.py Training runner · demo.py Demo runner · test.py Test runner · dataset_utils.py Training dataset
Components 18
Data preparation
- Training dataset
utils/dataset_utils.py - Degradation generation
utils/degradation_utils.py - Dataset manifests
data_dir
Model training
- Run configuration
options.py - Training runner
train.py - PromptIR network
net/model.py - Training loss
train.py - Learning-rate scheduler
utils/schedulers.py - Saved checkpoints
ckpt
Restoration inference
- Demo runner
demo.py - Image loading and saving
utils/image_io.py
Testing and metrics
- Test runner
test.py - Image test datasets
utils/dataset_utils.py - Quality metrics
utils/val_utils.py
Other components
- Researcher
- Input images
- Restored images
- Training logger
Connections 23
- Researcher → Run configuration: sets parameters
- Researcher → Training runner: starts training
- Run configuration → Training runner: configures
- Training runner → Training dataset: builds dataset
- Training dataset → Dataset manifests: reads manifests
- Training dataset → Degradation generation: generates corruptions
- Training runner → PromptIR network: trains network
- Training runner → Training loss: computes loss
- Training runner → Learning-rate scheduler: steps schedule
- Training runner → Saved checkpoints: saves checkpoints
- Training runner → Training logger: logs metrics
- Researcher → Demo runner: requests restoration
- Demo runner → Image test datasets: loads test images
- Demo runner → Image loading and saving: reads and writes
- Demo runner → Saved checkpoints: loads checkpoint
- Demo runner → PromptIR network: runs inference
- Input images → Demo runner: provides images
- Demo runner → Restored images: writes results
- Researcher → Test runner: runs evaluation
- Test runner → Image test datasets: selects task data
- Test runner → Saved checkpoints: loads checkpoint
- Test runner → PromptIR network: evaluates network
- Test runner → Quality metrics: computes scores