Skip to content

ratnajitmukherjee/hdr-expandnet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExpandNet

Create HDR images from LDR inputs:

| (left) LDR input | (middle) Exposures taken from the predicted HDR | (right) Tone mapped HDR |


Weights and code for:

ExpandNet: A Deep Convolutional Neural Network for High Dynamic Range Expansion from Low Dynamic Range Content

Demetris Marnerides, Thomas Bashford-Rogers, Jonathan Hatchett and Kurt Debattista

Paper will be presented at Eurographics 2018.

(arxiv version)


Prerequisites

Requires the PyTorch library along with OpenCV.

First follow the instructions for installing PyTorch.

To install OpenCV use:

conda install opencv -c menpo

Usage

The script accepts an LDR image as input, and creates an HDR Image prediction (.hdr file).

python expand.py  ldr_input.jpg

Can also do batch processing

python expand.py  *.jpg

To put results in a separate directory:

python expand.py  *.jpg --out results/

Results can be resized and filenames can be tagged:

python expand.py test.jpg --resize True --height 960 --width 540 --tag my-tag

If a GPU is available and Pytorch detects it then the conversion will happen on the GPU. To force CPU usage (slower) set --use_gpu False.

The network operates on patches to limit memory usage when expanding high resolution images. The flag --patch_size adjusts the size.

The resulting HDR Image can be tone mapped using the TMOs provided by OpenCV, or using the exposure operator.

python expand.py  test.jpg --tone_map reinhard

Testing on video

Use --video True (along with a tone mapper --tone_map) to test video conversion.

WARNING This is completely new and experimental. Very slow and memory consuming! Should only test short low-res clips. The model is not designed for videos thus flickering occurs which is reduced in the code by smoothing luminance percentile curves.

In the following example, on the left is the LDR video input and on the right is the (reinhard) tone mapped prediction.

Any tips to improve this are welcome!


Viewing HDR Images

There is a very easy to use online viewer at openhdr.org which also has tone mapping functionalities!


Contact: [email protected]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%