DeepHDR [1] (ECCV'18) re-implementation using PyTorch framework
This repository is the re-implementation of DeepHDR [1] using PyTorch framework. The original repository [2] is implemented using low-version Python and Tensorflow. To make the architecture clearer and more efficient, we re-implemented it using Pytorch framework and add some basic optimizations.
- PyTorch 1.4+
- Cuda version 10.1+
- OpenCV
- numpy, tqdm, scipy, etc.
The Kalantari Dataset can be downloaded from https://www.robots.ox.ac.uk/~szwu/storage/18_hdr/kalantari_dataset.zip [2], or you can execute the following commands to download it.
cd data
sh get_data.sh
There are two dataset models provided in dataset
folder. Using HDRpatches.py
will generate patches in patches
folder and will cost ~200GB spaces, but it runs faster. Using HDR.py
(default) will open image file only when it needs to do so, thus it will save disk space. Feel free to choose the method you want.
You may modify the arguments in Configs()
to satisfy your own environment, for specific arguments descriptions, see utils/configs.py
.
sh train.sh
Make sure that you have models (checkpoint.tar
) under checkpoint_dir
(which is defined in Configs()
).
sh test.sh
Note. test.py
will dump the result images in sample
folder.
Generated HDR images are in .hdr
format, which may not be properly displayed in your image viewer directly. You may use Photomatix for tonemapping [2]:
- Download Photomatix free trial, which won't expire.
- Load the generated
.hdr
file in Photomatix. - Adjust the parameter settings. You may refer to pre-defined styles, such as
Detailed
andPainterly2
. - Save your final image in
.tif
or.jpg
.
python calc_metric.py --gt_path [Ground Truth Path] --test_path [Test File Path]
This is a demo display of the testing dataset 002
using the model after only 1 epoch's trainning.
Original Image
LDR Image | |||
Exposure Bias | 0 | 3 | 6 |
HDR Image (after tonemapping)
- Training codes
- Evaluating while training
- Testing codes
- Perform the patches calculation in need to save storage
- Visualizing codes
- Code re-organization
- Sample
- Scripts
- Command-line configurations support
- Pre-trained model upload
- Multi-gpu support
- v0.10 (Current Version): Add metrics support.
- v0.9: Add some necessary scripts.
- v0.8: Add multi-gpu support.
- v0.7: Update dataset selection and fix some bugs.
- v0.6: Update demo display.
- v0.5: Modify the codes to satisfy CUDA environment.
- v0.4: Complete visualization codes.
- v0.3: Complete testing codes.
- v0.2: Complete the training codes to support evaluating in training process.
- v0.1: Build the model framework and write dataset codes, training codes and utility codes.
[1] Wu, Shangzhe, et al. "Deep high dynamic range imaging with large foreground motions." Proceedings of the European Conference on Computer Vision (ECCV). 2018.
[2] elliottwu/DeepHDR repository: https://github.com/elliottwu/DeepHDR
@inproceedings{wu2018deep,
title={Deep high dynamic range imaging with large foreground motions},
author={Wu, Shangzhe and Xu, Jiarui and Tai, Yu-Wing and Tang, Chi-Keung},
booktitle={Proceedings of the European Conference on Computer Vision (ECCV)},
pages={117--132},
year={2018}
}
@misc{fang2020deephdr,
author = {Hongjie Fang},
title = {DeepHDR re-implementation in PyTorch},
howpublished = {\url{https://github.com/Galaxies99/DeepHDR-pytorch}},
year = {2020}
}