Skip to content

PyTorch re-implementation of ECCV'18 paper: Deep High Dynamic Range Imaging with Large Foreground Motions

License

Notifications You must be signed in to change notification settings

Galaxies99/DeepHDR-pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeepHDR-pytorch

DeepHDR [1] (ECCV'18) re-implementation using PyTorch framework

Introduction

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.

Requirements

  • PyTorch 1.4+
  • Cuda version 10.1+
  • OpenCV
  • numpy, tqdm, scipy, etc.

Getting Started

Download Dataset

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

Dataset Model Selection

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.

Configs Modifications

You may modify the arguments in Configs() to satisfy your own environment, for specific arguments descriptions, see utils/configs.py.

Train

sh train.sh

Test

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.

Tone-mapping (post-processing)

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 and Painterly2.
  • Save your final image in .tif or .jpg.

Metric Calculation

python calc_metric.py --gt_path [Ground Truth Path] --test_path [Test File Path]

Sample

This is a demo display of the testing dataset 002 using the model after only 1 epoch's trainning.

Original Image

LDR Image
Exposure Bias036

HDR Image (after tonemapping)

To-dos

  • 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

Versions

  • 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.

Reference

[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

Citation

@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}
}

About

PyTorch re-implementation of ECCV'18 paper: Deep High Dynamic Range Imaging with Large Foreground Motions

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published