A unified Python toolkit for low-light image enhancement.
English Docs | 中文文档 | CLI | Configuration
LibLLIE is an open-source library for low-light image enhancement (LLIE). It brings traditional enhancement algorithms, deep-learning models, training, prediction, image I/O, and evaluation into one consistent interface.
The library is built for research and experimentation: you can quickly compare classical methods, run or train neural models, evaluate enhanced images, and extend the framework with your own models, losses, datasets, algorithms, or metrics.
- Unified top-level API:
predict,train,evaluate,imread,imwrite. - Training pipeline with YAML configuration, checkpoints, validation, and resumable experiments.
- Evaluation utilities for full-reference and no-reference image quality metrics such as PSNR, SSIM, MSE, MAE, LPIPS, LOE, NIQE, MUSIQ, and PI.
- Automatic component registration for custom extensions.
See below for a compact quick start. For complete guidance, use the full docs:
| Topic | English | Chinese |
|---|---|---|
| API overview | docs/guide/overview.md | docs-zh-CN/guide/overview.md |
| Image I/O | docs/guide/image_io.md | docs-zh-CN/guide/image_io.md |
| Prediction | docs/guide/predict.md | docs-zh-CN/guide/predict.md |
| Training | docs/guide/train.md | docs-zh-CN/guide/train.md |
| Evaluation | docs/guide/evaluate.md | docs-zh-CN/guide/evaluate.md |
| CLI | docs/usage/cli.md | docs-zh-CN/usage/cli.md |
| Configuration | docs/usage/cfg.md | docs-zh-CN/usage/cfg.md |
Install
LibLLIE requires Python>=3.8 and PyTorch>=2.0.
Clone the repository, then install from source when developing or using the latest GitHub version:
cd LibLLIE
pip install -e .also, you can install it as a regular package: (Not yet implemented.)
pip install libllieQuick Start
### CLIYou can use either libllie or llie as the command.
# List registered models, algorithms, metrics, losses, and datasets
libllie list # or llie list
# Enhance one image with a traditional method
libllie predict he input.jpg -o results/he_output.png
# or
llie predict he input.jpg -o results/he_output.png
# Evaluate enhanced images
libllie evaluate --en-img-dir path/to/enhanced/images/dir --ref-img-dir path/to/reference/images/dir --metrics PSNR SSIM
# or
llie eval --en path/to/enhanced/images/dir --ref path/to/reference/images/dir --metrics PSNR SSIMFor traditional algorithms, you only need to provide the algorithm name and the low-light-enhanced image to be enhanced.
import libllie as llie
enhanced, saved_path = llie.predict(
"he",
"input.jpg", # low-light-image
output="results/he_output.png",
)For deep-learning inference, pass a trained checkpoint path:
enhanced, saved_path = llie.predict(
"path/to/llie.pt",
"input.jpg",
output="results/zerodce_output.png",
device="cuda",
)Deep-Learning Models
| Model | years | venue | paper | official code |
|---|---|---|---|---|
| Zero-DCE | 2020 | CVPR | paper | code |
| Zero-DCE++ | 2021 | IEEE TPAMI | paper | code |
| SCI | 2022 | CVPR | paper | code |
| RUAS | 2021 | CVPR | paper | code |
| URetinex-Net | 2022 | CVPR | paper | code |
| RetinexFormer | 2023 | ICCV | paper | code |
| LEDNet | 2022 | ECCV | paper | code |
| Zero-IG | 2024 | CVPR | paper | code |
| DarkIR | 2025 | CVPR | paper | code |
| LLNet | 2017 | Pattern Recognition | paper | code |
| KinD | 2019 | ACM MM | paper | code |
| KinD++ | 2021 | IJCV | paper | code |
| EnlightenGAN | 2021 | IEEE TIP | paper | code |
| LLFlow | 2022 | AAAI | paper | code |
Traditional Algorithms
| Algorithm | Documentation |
|---|---|
| HE | docs/algorithms/he.md |
| AHE | docs/algorithms/ahe.md |
| CLAHE | docs/algorithms/clahe.md |
| RCLAHE | docs/algorithms/rclahe.md |
| Gamma | docs/algorithms/gamma.md |
| GCP | docs/algorithms/gcp.md |
| LIME | docs/algorithms/lime.md |
| BIMEF | docs/algorithms/bimef.md |
| NPE | docs/algorithms/npe.md |
| Retinex | docs/algorithms/retinex.md |
| Log | docs/algorithms/log.md |
| DCP | docs/algorithms/dcp.md |
Evaluation Metrics
| Type | Metrics |
|---|---|
| Full-reference | PSNR, SSIM, MSE, MAE, LPIPS, LOE |
| No-reference | NIQE, MUSIQ, PI |
See docs/guide/evaluate.md and docs/custom/metric.md for usage and extension details.
LibLLIE provides a unified trainer for registered models and datasets. You can train through keyword arguments:
import libllie as llie
llie.train(
model="ZeroDCE",
dataset="CommonDataset",
root_dir="datasets/LOL",
loss="zerodce",
epochs=10,
batch_size=4,
device="cuda",
)Or train from YAML:
llie.train("libllie/deepLearning/config/ZeroDCE.yaml")Training outputs are saved under checkpoints/{Model}_{Dataset} by default,
including checkpoints, logs, and the resolved training configuration.
LibLLIE uses automatic registration for major components. After a custom component is imported, it can be listed and used through the same top-level API.
| Component | Base class | Guide |
|---|---|---|
| Deep-learning model | LLIEModel |
custom model |
| Training loss | BaseLoss |
custom loss |
| Dataset | BaseDataset |
custom dataset |
| Traditional algorithm | LLIEnhancer |
custom algorithm |
| Evaluation metric | BaseMetric |
custom metric |
libllie/
data/ Image I/O, transforms, datasets
traditional/ Traditional LLIE algorithms
deepLearning/ Models, losses, trainer, predictor, YAML configs
evaluation/ Evaluator and image quality metrics
docs/ English documentation
docs-zh-CN/ Chinese documentation
examples/ Runnable examples
test/ Test suite
Run the test suite:
python -m pytest -q testContributions are welcome. Good first contributions include:
- adding or improving algorithm documentation,
- adding examples for existing models,
- implementing new LLIE algorithms or metrics,
- improving tests for training, prediction, and evaluation workflows.
Please keep new components consistent with the existing registration system and add focused tests when behavior changes.
LibLLIE is released under the MIT License. See LICENSE.
Glory Wan
glory947446@gmail.com
coming soon