Retinexformer is a training toolbox as much as a model
"Retinexformer: One-stage Retinex-based Transformer for Low-light Image Enhancement" (ICCV 2023 Top-10 Cited 🏆) & (NTIRE 2024 Runner-Up 🏆) & (NTIRE 2025 Winner 🏆) & (NTIRE 2026 Winner 🏆)
At a glance
- What is it?
- The Retinexformer repository is both the code for an ICCV 2023 low-light enhancement model and a research baseline other challenge winners built on, with training strategies, testing strategies and released results across more than fifteen benchmarks. Its most reusable assets are the strategies and the comparison results, not the weights.
- Who is it for?
- Adopt this repository as a training and evaluation baseline if you are researching low-light enhancement, since it gives distributed training, mixed precision, self-ensemble and high-resolution split-and-test already written, plus published comparison results. Do not adopt it as a turnkey enhancement API, because the repository ships research code with a vendored BasicSR rather than a maintained library.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 153 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.
Editorial analysis
The model, and the chain of winners built on it
The paper behind this code is `Retinexformer: One-stage Retinex-based Transformer for Low-light Image Enhancement`, accepted at ICCV 2023, with the arXiv identifier 2303.06705. The repository describes itself as a baseline and toolbox for low-light image enhancement.
What makes it more than a model release is the adoption trail. The method took second place in the NTIRE 2024 Challenge on Low Light Enhancement. Then, in 2025 and again in 2026, challenge winning solutions were built on top of Retinexformer: the NTIRE 2025 winner, and the winner of the NTIRE 2026 Efficient Low-light Image Enhancement Challenge, whose report the README links.
That is a different kind of evidence than a leaderboard entry. A method that becomes the base layer for someone else's winning entry has demonstrated that it is workable to build on, not merely that it scores well once.
There is also a lineage in the other direction. An enhanced version of Retinexformer was accepted at ECCV 2024 and released in a separate repository, redrock303/ADF-LLIE, so the model here is the 2023 version and an improved variant exists elsewhere. RetinexMamba, described as the first Mamba work on low-light enhancement, is built on this framework.
The last push was on 2026-05-23, and the repository has no GitHub releases to pin.
Training strategies released alongside the model
The 2024.03.22 news entry is the one to read if you intend to train rather than just run. Three additions landed together: distributed data parallel training, mixed-precision training, and a self-ensemble testing strategy.
Distributed and mixed-precision training are described as being there to help you train larger models, which is the honest reason they were added: a low-light enhancement network at full resolution is expensive, and the reference configuration was not a budget a single GPU covers.
Self-ensemble is a testing-time strategy, and the framing is worth reading carefully because it affects reported numbers. Applying the model several times and averaging is a common trick for reporting better metrics at the cost of several forward passes per image. The README presents it as a way to derive better results, which is exactly what it is: an evaluation-time knob rather than a property of the model.
The repository layout matches this. There is a `basicsr/` directory holding a vendored copy of BasicSR, an `Options/` directory for configuration, an `Enhancement/` directory for the enhancement code, and `train_multigpu.sh` at the root for distributed runs. Vendoring the training framework rather than depending on it means the code runs against the version the authors used, and it also means you inherit that version's maintenance state.
High resolution is the hardest case here
The claim that this repo supports more than fifteen benchmarks and extremely high resolution, up to 4000x6000, is the one that separates it from a demo.
The mechanism is the third strategy released on 2024.03.22, an adaptive `split-and-test` strategy for high-resolution low-light enhancement. Rather than feeding a 4000x6000 image through the network as one tensor, the image is split into tiles, each is processed, and the results are reassembled. Adaptive means the split follows the image rather than being a fixed grid you have to pick yourself.
The practical consequence is that this repository covers a case most low-light models quietly avoid: night photography where the output has to stay sharp at print resolution. The cost is memory and time, since a tiled pass processes more pixels in total than a single pass, and the reassembly has to be correct at tile boundaries for the result to be usable.
Results are released rather than left to be regenerated. The README provides downloads on Baidu Disk and Google Drive for LOL-v1, LOL-v2-real, LOL-v2-synthetic, SID, SMID, SDSD-in, SDSD-out and MIT Adobe FiveK, and also for the NTIRE 2024 low-light enhancement dataset. Baseline comparison results from 2024.07.03 are available separately, and there is a separate repository for the script that draws the teaser bar comparison.
The evaluation warning is the most useful line in the README
The 2023.11.03 news entry warns about the test setting used by KinD, LLFlow and recent diffusion models, and the repository supplies those results so you can compare against them.
The warning is explicit: the authors do not suggest that test setting because it uses the mean of the ground truth to obtain better results. If you want to follow those works for comparison, they say, that is your choice, and the details are in the Testing section.
That is a small paragraph with a large consequence. A test setting that uses ground truth statistics inflates every method evaluated under it, so numbers produced that way are not comparable with numbers produced another way. It is easy to inherit such a setting by copying a baseline's evaluation code and never notice.
Anyone using this repository as a baseline should decide which protocol they are on before comparing anything, and record it. The repository gives you both sets of results and tells you which one they distrust.
There is also downstream-task evidence here: results on ExDark nighttime object detection were released in 2023.09.20, which matters because enhancement that looks good and breaks a detector is not useful in a pipeline.
Building it
The repository is a Python project with a C and CUDA extension build. setup.py imports the extension helpers from PyTorch at build time:
from torch.utils.cpp_extension import (BuildExtension, CppExtension,
CUDAExtension)The build also stamps the version. It reads the short version string from a `VERSION` file at the repository root, derives a full version from either the current git commit hash or, when there is no `.git` directory, the version recorded in `basicsr/version.py`, and writes a generated version module. If neither source is available the hash falls back to `unknown` rather than failing.
That mechanism is worth knowing about because there are no GitHub releases. A checkout, a tarball and a pip install can carry different version strings, and the `VERSION` file plus the git hash are what tell you which one you have.
There is a `setup.cfg` alongside `setup.py`, and the licence is MIT in `LICENSE.txt`.
Editorial conclusion
Adopt this repository as a training and evaluation baseline if you are researching low-light enhancement, since it gives distributed training, mixed precision, self-ensemble and high-resolution split-and-test already written, plus published comparison results. Do not adopt it as a turnkey enhancement API, because the repository ships research code with a vendored BasicSR rather than a maintained library. Verify first that the evaluation protocol matches the one your comparison uses, since the README explicitly discourages the KinD and LLFlow test setting, and check whether the ECCV 2024 enhanced version at redrock303/ADF-LLIE supersedes the model here.
Frequently asked questions
What is Retinexformer used for?
It is a one-stage Retinex-based Transformer for low-light image enhancement, from a paper accepted at ICCV 2023. The repository is described as both a baseline and a toolbox for that task.
What is the split-and-test strategy in Retinexformer?
It is an adaptive testing strategy for high-resolution low-light enhancement up to 4000x6000, splitting an image for processing and reassembling the result, released alongside the DDP and mixed-precision training strategies in March 2024.
Why does the README discourage the KinD and LLFlow test setting?
Because that setting uses the mean of the ground truth to obtain better results, which the authors say inflates outcomes. They still provide results under it for people who want a like-for-like comparison with those works.
Is there an improved version of Retinexformer?
Yes. An enhanced version accepted at ECCV 2024 was released in a separate repository, redrock303/ADF-LLIE. RetinexMamba is also built on the framework here.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/caiyuanhao1998-retinexformer)Was this useful?