Skip to content

AndreGuo/LHDR

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

LHDR_PyTorch

The official PyTorch implementation of paper "LHDR: HDR Reconstruction for Legacy Content using a Lightweight DNN" (paper (ArXiv), paper, supplementary material) in ACCV2022.

@inproceedings{guo2022lhdr,
  title={LHDR: HDR Reconstructionfor Legacy Content using a Lightweight DNN}, 
  author={Guo, Cheng and Jiang Xiuhua},
  booktitle={Proceedings of the 16th Asian Conference on Computer Vision},
  year={2022},
  pages={3155-3171}
}

1. Overview

1.1 Our scope

This method belongs to computer vision (CV) -> image-to-image (I2I) -> low-level vision -> high dynamic range (HDR) related.

NOTE THAT this method DONNOT belong to multi-exposure HDR imaging which takes merge multiple images into HDR, it belongs to single-image reconstruction (SI-HDR) who predict HDR from single image.

1.2 Key features

Our LHDR tackles 2 issues of current methods:

  • The first L: current methods could not well process Legacy content with degradations e.g. camera noise, JPEG compression and over-exposure etc.
  • The second L: current methods are too bulky for real application, so we have to design a more Lightweight network.

2. Getting Started

2.1 Prerequisites

  • Python
  • PyTorch
  • OpenCV
  • NumPy
  • NVIDIA GPU, cnDNN, CUDA (only for training)

2.2 How to test

Run test.py with below configuration(s):

python test.py imgName.jpg

When batch processing, use wildcard *:

python test.py imgPath/*.jpg

Add below configuration(s) for specific propose:

Propose Configuration
Specify output path -out resultDir/
Resize image before inference -resize True -height newH -width newW
Add filename tag -tag yourTag
Force CPU processing -use_gpu False
Change precision to half (when GRAM OMM) -half True
Save result in another format (defalut .hdr) -out_format suffix
png as 16bit .png
exr require extra package openEXR
Donnot linerize the output HDR -linearize False

2.3 How to train

Put our network.py under your own PyTorch scheme, e.g. BasicSR, and change the dataloader etc., remember to:

  • Normalize input SDR (img) by dividing 255.0. Note that the input to network is a tuple [img,s_cond,c_cond], see line145 in test.py for detail.
  • Transfer the normalized label HDR to non-linear domain by 0.45 exponent (as our pre-processing specified in paper).
  • Change channel order BGR (if so) to RGB.

Contact

Guo Cheng (Andre Guo) guocheng@cuc.edu.cn

  • State Key Laboratory of Media Convergence and Communication (MCC), Communication University of China (CUC), Beijing, China.
  • Peng Cheng Laboratory (PCL), Shenzhen, China.

About

The official PyTorch implementation of paper 'LHDR: HDR Reconstruction for Legacy Content using a Lightweight DNN' in ACCV2022.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages