/twostageHDR_NTIRE21

This is the official implementation of Two-stage LDR to HDR Image Reconstruction from CVPRW21. This repo also hosts the LDR52 dataset, which has introduces in the paper.

Primary LanguagePython

Two-stage LDR to HDR Image Reconstruction

This is the official implementation of paper title "A Two-stage Deep Network for High Dynamic Range Image Reconstruction". The paper has been accepted and expected to be published in the proceedings of CVPRW21. To download full paper [Click Here].

Please consider to cite this paper as follows:

@inproceedings{a2021two,
  title={A two-stage deep network for high dynamic range image reconstruction},
  author={Sharif, SMA and Naqvi, Rizwan Ali and Biswas, Mithun and Kim, Sungjun},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={550--559},
  year={2021}
}

Overview

Overview

Figure: Overview of the proposed method. The proposed method comprises a two-stage deep network. Stage-I aims toperform image enhancement task denoising, exposure correction, etc. Stage-II of the proposed method intends to performtone mapping and bit-expansion.

Comparison with state-of-the-art sigle-shot LDR to HDR Deep methods

Overview

Figure: Quantitative comparison between proposed method and existing learning-based single-shot LDR to HDR methods..

Prerequisites

Python 3.8
CUDA 10.1 + CuDNN
pip
Virtual environment (optional)

Installation

Please consider using a virtual environment to continue the installation process.

git clone https://github.com/sharif-apu/twostageHDR_NTIRE21.git
cd twostageHDR_NTIRE21
pip install -r requirement.txt

Training

To download the training images please visit the following link: [Click Here] and extract the zip files in common directory.
The original paper used image patches from HdM HDR dataset. To extract image patches please execute Extras/processHDMDHR.py script from the root directory as follows:

python processHDMDHR.py -r path/to/HdM/root/ -t path/to/save/patch -p 256
Here -r flag defines your root directory of the HdM HDR training samples, -s flag defines the directory where patches should be saved, and -p flag defines the patch size


After extracting patch please execute the following commands to start training:

python main.py -ts -e X -b Y To specify your trining images path, go to mainModule/config.json and update "trainingImagePath" entity.
You can specify the number of epoch with -e flag (i.e., -e 5) and number of images per batch with -b flag (i.e., -b 24).

Please Note: The provided code aims to train only with medium exposure frames. To train with short/long exposure frames, you need to modify the dataTools/customDataloader (line 68) and mainModule/twostageHDR (line 87).

For transfer learning execute:
python main.py -tr -e -b

Testing

The provided weights are trained as per rule of NTIRE21 HDR challange (single frame). To download the testing images please visit the following link: [Click Here]

To inference with provided pretrained weights please execute the following commands:
python main.py -i -s path/to/inputImages -d path/to/outputImages
Here,-s specifies the root directory of the source images (i.e., testingImages/), and -d specifies the destination root (i.e., modelOutput/).

LDR52 Dataset

We have collected a LDR dataset captured with different camera hardwares. Feel free to use our LDR dataset for your work. The dataset can be downloaded from the following link: [Click Here] (Updated Link)

Contact

For any further query, feel free to contact us through the following emails: apuism@gmail.com, rizwanali@sejong.ac.kr, or mithun.bishwash.cse@ulab.edu.bd