How johnscotttt/low_light_image_enhancement works
This repository implements paired low-light image enhancement: prepare low/normal image lists, train the enhancement model, then run inference and optionally save enhanced images while reporting quality metrics. Training combines a detail network with a wavelet-conditioned diffusion network and optimizes them with component losses; evaluation uses the configured dataset and a supplied checkpoint. The README documents LOL/LOLv2 datalist generation and callable train/eval entry points. Some runner and model wiring is only partially sampled, so uncertain internal connections are omitted.
Main entry points: runner.py Train and eval · model.py Enhancement model · ddm.py Diffusion network · preprocessing.py Datalist generation
Components 18
Data preparation
- Datalist generation
utils/preprocessing.py - Pair TSV
- Paired data loader
modules/dataloader.py
Training and evaluation
- Default config
cfg/default.toml - Train entry
train.py - Train and eval
modules/runner.py - Model weights
- Enhanced images
Enhancement network
- Enhancement model
modules/model.py - Detail network
modules/detail.py - Diffusion network
modules/ddm.py - Diffusion U-Net
modules/diffusion.py - Wavelet transforms
modules/wavelet.py
Loss and quality
- Training losses
modules/loss.py - Image metrics
utils/metrics.py - LPIPS metric
Other components
- Researcher
- Paired images
Connections 19
- Researcher → Datalist generation: requests lists
- Paired images → Datalist generation: reads pairs
- Datalist generation → Pair TSV: writes lists
- Researcher → Train entry: starts training
- Train entry → Train and eval: calls train
- Researcher → Train and eval: calls eval
- Default config → Train and eval: configures runs
- Pair TSV → Paired data loader: provides pairs
- Train and eval → Paired data loader: loads batches
- Train and eval → Enhancement model: constructs and runs
- Enhancement model → Detail network: uses detail branch
- Enhancement model → Diffusion network: uses diffusion branch
- Diffusion network → Diffusion U-Net: denoises
- Diffusion network → Wavelet transforms: transforms bands
- Train and eval → Training losses: computes training loss
- Train and eval → Image metrics: scores predictions
- Train and eval → Model weights: saves or loads
- Train and eval → Enhanced images: saves enhanced output
- Train and eval → LPIPS metric: computes LPIPS