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
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
+
pipeline_tag: image-to-image
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
# DarkIR: Robust Low-Light Image Restoration
|
| 7 |
+
|
| 8 |
+
[](https://huggingface.co/spaces/Cidaut/DarkIR)
|
| 9 |
+
[](https://huggingface.co/papers/2412.13443)
|
| 10 |
+
[](https://github.com/cidautai/DarkIR)
|
| 11 |
+
|
| 12 |
+
This repository contains the official model for the paper [DarkIR: Robust Low-Light Image Restoration](https://huggingface.co/papers/2412.13443), presented at CVPR 2025.
|
| 13 |
+
|
| 14 |
+
**[Daniel Feijoo](https://scholar.google.com/citations?hl=en&user=hqbPn4YAAAAJ), [Juan C. Benito](https://scholar.google.com/citations?hl=en&user=f186MIUAAAAJ), [Alvaro Garcia](https://scholar.google.com/citations?hl=en&user=c6SJPnMAAAAJ), [Marcos V. Conde](https://scholar.google.com/citations?user=NtB1kjYAAAAJ&hl=en)** (CIDAUT AI and University of Wuerzburg)
|
| 15 |
+
|
| 16 |
+
**TLDR.** Photography in low-light conditions often results in noisy and blurry images. While previous methods address these issues separately, DarkIR proposes the first all-in-one approach for low-light restoration, including illumination, noise, and blur enhancement with a single model.
|
| 17 |
+
|
| 18 |
+
<details>
|
| 19 |
+
<summary> <b> ABSTRACT </b> </summary>
|
| 20 |
+
Photography during night or in dark conditions typically suffers from noise, low light and blurring issues due to the dim environment and the common use of long exposure. Although Deblurring and Low-light Image Enhancement (LLIE) are related under these conditions, most approaches in image restoration solve these tasks separately. In this paper, we present an efficient and robust neural network for multi-task low-light image restoration. Instead of following the current tendency of Transformer-based models, we propose new attention mechanisms to enhance the receptive field of efficient CNNs. Our method reduces the computational costs in terms of parameters and MAC operations compared to previous methods. Our model, DarkIR, achieves new state-of-the-art results on the popular LOLBlur, LOLv2 and Real-LOLBlur datasets, being able to generalize on real-world night and dark images.
|
| 21 |
+
</details>
|
| 22 |
+
|
| 23 |
+
DarkIR achieves new state-of-the-art results on popular datasets like LOLBlur, LOLv2, and Real-LOLBlur, demonstrating strong generalization capabilities on real-world night and dark images.
|
| 24 |
+
|
| 25 |
+
| <img src="https://github.com/cidautai/DarkIR/raw/main/assets/teaser/0085_low.png" alt="Low-light w/ blur" width="450"> | <img src="https://github.com/cidautai/DarkIR/raw/main/assets/teaser/0085_retinexformer.png" alt="RetinexFormer" width="450"> | <img src="https://github.com/cidautai/DarkIR/raw/main/assets/teaser/0085_darkir.png" alt="DarkIR (ours)" width="450"> |
|
| 26 |
+
|:-------------------------:|:-------------------------:|:-------------------------:|
|
| 27 |
+
| Low-light w/ blur | RetinexFormer | **DarkIR** (ours) |
|
| 28 |
+
| <img src="https://github.com/cidautai/DarkIR/raw/main/assets/teaser/low00747.png" alt="Low-light w/o blur" width="450"> | <img src="https://github.com/cidautai/DarkIR/raw/main/assets/teaser/low00747_lednet.png" alt="LEDNet" width="450"> | <img src="https://github.com/cidautai/DarkIR/raw/main/assets/teaser/low00747_darkir.png" alt="DarkIR (ours)" width="450"> |
|
| 29 |
+
| Low-light w/o blur | LEDNet | **DarkIR** (ours) |
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
## Network Architecture
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
|
| 37 |
+
## Dependencies and Installation
|
| 38 |
+
|
| 39 |
+
- Python == 3.10.12
|
| 40 |
+
- PyTorch == 2.5.1
|
| 41 |
+
- CUDA == 12.4
|
| 42 |
+
- Other required packages in `requirements.txt`
|
| 43 |
+
|
| 44 |
+
```bash
|
| 45 |
+
# git clone this repository
|
| 46 |
+
git clone https://github.com/Fundacion-Cidaut/DarkIR.git
|
| 47 |
+
cd DarkIR
|
| 48 |
+
|
| 49 |
+
# create python environment
|
| 50 |
+
python3 -m venv venv_DarkIR
|
| 51 |
+
source venv_DarkIR/bin/activate
|
| 52 |
+
|
| 53 |
+
# install python dependencies
|
| 54 |
+
pip install -r requirements.txt
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
## Datasets
|
| 58 |
+
The datasets used for training and/or evaluation are:
|
| 59 |
+
|
| 60 |
+
|Dataset | Sets of images | Source |
|
| 61 |
+
| -----------| :---------------:|------|
|
| 62 |
+
|LOL-Blur | 10200 training pairs / 1800 test pairs| [LEDNet](https://github.com/sczhou/LEDNet) |
|
| 63 |
+
|LOLv2-real | 689 training pairs / 100 test pairs | [Google Drive](https://drive.google.com/file/d/1dzuLCk9_gE2bFF222n3-7GVUlSVHpMYC/view) |
|
| 64 |
+
|LOLv2-synth | 900 training pairs / 100 test pairs | [Google Drive](https://drive.google.com/file/d/1dzuLCk9_gE2bFF222n3-7GVUlSVHpMYC/view) |
|
| 65 |
+
|LOL | 485 training pairs / 15 test pairs | [Official Site](https://daooshee.github.io/BMVC2018website/) |
|
| 66 |
+
|Real-LOLBlur | 1354 unpaired images | [LEDNet](https://github.com/sczhou/LEDNet) |
|
| 67 |
+
|LSRW-Nikon | 3150 training pairs / 20 test pairs | [R2RNet](https://github.com/JianghaiSCU/R2RNet) |
|
| 68 |
+
|LSRW-Huawei | 2450 training pairs / 30 test pairs | [R2RNet](https://github.com/JianghaiSCU/R2RNet) |
|
| 69 |
+
|
| 70 |
+
You can download each specific dataset and put it on the `/data/datasets` folder for testing.
|
| 71 |
+
|
| 72 |
+
## Results
|
| 73 |
+
We present results in different datasets for DarkIR of different sizes. While **DarkIR-m** has channel depth of 32, 3.31 M parameters and 7.25 GMACs, **DarkIR-l** has channel depth 64, 12.96 M parameters and 27.19 GMACs.
|
| 74 |
+
|
| 75 |
+
|Dataset | Model| PSNR| SSIM | LPIPS |
|
| 76 |
+
| -----------| :---------------:|:------:|------|------|
|
| 77 |
+
|LOL-Blur | DarkIR-m| 27.00| 0.883| 0.162|
|
| 78 |
+
| | DarkIR-l| 27.30| 0.898| 0.137|
|
| 79 |
+
|LOLv2-real | DarkIR-m| 23.87| 0.880| 0.186|
|
| 80 |
+
|LOLv2-synth | DarkIR-m| 25.54| 0.934| 0.058|
|
| 81 |
+
|LSRW-Both | DarkIR-m| 18.93| 0.583| 0.412|
|
| 82 |
+
|
| 83 |
+
We present perceptual metrics for Real-LOLBlur dataset:
|
| 84 |
+
|
| 85 |
+
| Model| MUSIQ| NRQM | NIQE |
|
| 86 |
+
| -----------| :---------------:|:------:|:------:|
|
| 87 |
+
| DarkIR-m| 48.36| 4.983| 4.998|
|
| 88 |
+
| DarkIR-l| 48.79| 4.917| 5.051|
|
| 89 |
+
|
| 90 |
+
## Evaluation
|
| 91 |
+
|
| 92 |
+
To check our results you could run the evaluation of DarkIR in each of the datasets:
|
| 93 |
+
|
| 94 |
+
- Download the weights of the model from [OneDrive](https://cidautes-my.sharepoint.com/:f:/g/personal/alvgar_cidaut_es/Epntbl4SucFNpeIT_jyYZ-cB9BamMbacbyq_svrkMCpShA?e=XB9YBB) and put them in `/models`.
|
| 95 |
+
- run `python testing.py -p ./options/test/<config.yml>`. Default is LOLBlur.
|
| 96 |
+
|
| 97 |
+
You may also check the qualitative results in `Real-LOLBlur` and LLIE unpaired by running `python testing_unpaired.py -p ./options/test/<config.yml>`. Default is RealBlur.
|
| 98 |
+
|
| 99 |
+
## Inference
|
| 100 |
+
|
| 101 |
+
You can restore a whole set of images in a folder by running:
|
| 102 |
+
|
| 103 |
+
```bash
|
| 104 |
+
python inference.py -i <folder_path>
|
| 105 |
+
```
|
| 106 |
+
|
| 107 |
+
Restored images will be saved in `./images/results`.
|
| 108 |
+
|
| 109 |
+
To inference a video you can run
|
| 110 |
+
|
| 111 |
+
```bash
|
| 112 |
+
python inference_video.py -i /path/to/video.mp4
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
+
which will be saved in `./videos/results`.
|
| 116 |
+
|
| 117 |
+
## Gallery
|
| 118 |
+
|
| 119 |
+
<p align="center"> <strong> LOLv2-real </strong> </p>
|
| 120 |
+
|
| 121 |
+
| <img src="https://github.com/cidautai/DarkIR/raw/main/assets/lolv2real/low00733_low.png" alt="Low-light" width="300"> | <img src="https://github.com/cidautai/DarkIR/raw/main/assets/lolv2real/00733_snr.png" alt="SNR-Net" width="300"> | <img src="https://github.com/cidautai/DarkIR/raw/main/assets/lolv2real/low00733_retinexformer.png" alt="RetinexFormer" width="300"> | <img src="https://github.com/cidautai/DarkIR/raw/main/assets/lolv2real/low00733_darkir.png" alt="DarkIR (ours)" width="300"> | <img src="https://github.com/cidautai/DarkIR/raw/main/assets/lolv2real/normal00733.png" alt="Ground Truth" width="300"> |
|
| 122 |
+
|:-------------------------:|:-------------------------:|:-------------------------:|:-------------------------:|:-------------------------:|
|
| 123 |
+
| Low-light | SNR-Net | RetinexFormer | **DarkIR** (ours) | Ground Truth |
|
| 124 |
+
|
| 125 |
+
<p align="center"> <strong> LOLv2-synth </strong> </p>
|
| 126 |
+
|
| 127 |
+
| <img src="https://github.com/cidautai/DarkIR/raw/main/assets/lolv2synth/r13073518t_low.png" alt="Low-light" width="300"> | <img src="https://github.com/cidautai/DarkIR/raw/main/assets/lolv2synth/r13073518t_snr.png" alt="SNR-Net" width="300"> | <img src="https://github.com/cidautai/DarkIR/raw/main/assets/lolv2synth/r13073518t_retinexformer.png" alt="RetinexFormer" width="300"> | <img src="https://github.com/cidautai/DarkIR/raw/main/assets/lolv2synth/r13073518t_darkir.png" alt="DarkIR (ours)" width="300"> | <img src="https://github.com/cidautai/DarkIR/raw/main/assets/lolv2synth/r13073518t_normal.png" alt="Ground Truth" width="300"> |
|
| 128 |
+
|:-------------------------:|:-------------------------:|:-------------------------:|:-------------------------:|:-------------------------:|\
|
| 129 |
+
| Low-light | SNR-Net | RetinexFormer | **DarkIR** (ours) | Ground Truth |
|
| 130 |
+
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
<p align="center"> <strong> Real-LOLBlur-Night </strong> </p>
|
| 134 |
+
|
| 135 |
+
<p align="center"> <img src="https://github.com/cidautai/DarkIR/raw/main/assets/qualis_realblur_night.jpg" alt="Example Image" width="70%"> </p>
|
| 136 |
+
|
| 137 |
+
## Citation and acknowledgement
|
| 138 |
+
|
| 139 |
+
This work has been accepted for publication and presentation at The IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) 2025.
|
| 140 |
+
|
| 141 |
+
```bibtex
|
| 142 |
+
@InProceedings{Feijoo_2025_CVPR,
|
| 143 |
+
author = {Feijoo, Daniel and Benito, Juan C. and Garcia, Alvaro and Conde, Marcos V.},
|
| 144 |
+
title = {DarkIR: Robust Low-Light Image Restoration},
|
| 145 |
+
booktitle = {Proceedings of the Computer Vision and Pattern Recognition Conference (CVPR)},
|
| 146 |
+
month = {June},
|
| 147 |
+
year = {2025},
|
| 148 |
+
pages = {10879-10889}
|
| 149 |
+
}
|
| 150 |
+
```
|
| 151 |
+
|
| 152 |
+
## Contact
|
| 153 |
+
|
| 154 |
+
If you have any questions, please contact danfei@cidaut.es and marcos.conde@uni-wuerzburg.de
|