How weichen582/retinexnet works
RetinexNet is a TensorFlow low-light image enhancement application. Its main workflow accepts low-light images, decomposes them into reflectance and illumination, relights the illumination, and combines the results into enhanced images; optional decomposition outputs can also be saved. Training uses paired low-/high-light images in separate decomposition and relighting phases, with evaluation and checkpoints. The model excerpts are partial, so internal training details beyond the shown calls are kept high-level.
Main entry points: main.py CLI Workflow · model.py Enhancement Controller · utils.py Image I/O · data Training Pairs
Components 16
Application Workflow
- CLI Workflow
main.py - Evaluation Samples
model.py - Saved Results
Enhancement Model
- Enhancement Controller
model.py - Retinex Decomposition
model.py - Illumination Relighting
model.py - Image Reconstruction
model.py - Phase Training
model.py
Image Data
- Training Pairs
data - Evaluation Images
data/eval/low - Test Images
data/test/low - Image I/O
utils.py
Model State
- Checkpoint Handling
model.py - Decomposition Weights
model/Decom - Relighting Weights
model/Relight
Other components
- User
Connections 23
- User → CLI Workflow: chooses phase
- Training Pairs → CLI Workflow: training inputs
- Evaluation Images → CLI Workflow: evaluation inputs
- Test Images → CLI Workflow: test inputs
- CLI Workflow → Image I/O: loads images
- CLI Workflow → Enhancement Controller: invokes training or test
- CLI Workflow → Phase Training: starts both phases
- CLI Workflow → Evaluation Samples: sets sample destination
- CLI Workflow → Saved Results: sets save destination
- Enhancement Controller → Retinex Decomposition: builds decomposition
- Enhancement Controller → Illumination Relighting: builds relighting
- Enhancement Controller → Image Reconstruction: builds enhanced output
- Enhancement Controller → Phase Training: implements train
- Enhancement Controller → Checkpoint Handling: loads and saves
- Retinex Decomposition → Illumination Relighting: supplies reflectance and illumination
- Illumination Relighting → Image Reconstruction: supplies relit illumination
- Retinex Decomposition → Image Reconstruction: supplies reflectance
- Phase Training → Evaluation Samples: evaluates periodically
- Phase Training → Checkpoint Handling: saves phase weights
- Checkpoint Handling → Decomposition Weights: restores or saves
- Checkpoint Handling → Relighting Weights: restores or saves
- Enhancement Controller → Image I/O: writes result images
- Image I/O → Saved Results: saves PNGs