Code Monkey home page Code Monkey logo

nhdrrnet-pytorch's Introduction

NHDRRNet-pytorch

📷 NHDRRNet (TIP'20) implementation using PyTorch framework

Introduction

This repository is the implementation of NHDRRNet [2] using PyTorch framework. The author did not open the code, therefore, we create this repository to implement NHDRRNet using PyTorch framework.

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/hdr/kalantari_dataset.zip [2].

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.
  • You may modify arguments of NHDRRNet to train a better model, for specific arguments descriptions, see config dictionary in models/NHDRRNet.py.

Train

python train.py

Test

First, make sure that you have models (checkpoint.tar) under checkpoint_dir (which is defined in Configs()).

python test.py

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.

Reference

[1] Yan, Qingsen, et al. "Deep hdr imaging via a non-local network." IEEE Transactions on Image Processing 29 (2020): 4308-4322.

[2] elliottwu/DeepHDR repository: https://github.com/elliottwu/DeepHDR

nhdrrnet-pytorch's People

Contributors

chenzhicun avatar galaxies99 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nhdrrnet-pytorch's Issues

Is the results of this method higher than AHDRNet?

Thanks a lots for your contribution. I look forward to obtain a baseline based on Pytorch. But I cannot re-implement the original results. I want to ask one question: is the results of this method higher than AHDRNet?

A bug in the training phase

Hello,first thanks for your code!

when I train the model follow you tips, I found that the code will go wrong when I was training. Then I found the error occurs in models/NHDRRNet.py, line 206. In more detail, the error will occur when runing the function of eval_one_epoch() after finishing one epoch.

The error info is RuntimeError: Sizes of tensors must match except in dimension 2. Got 125 and 124 (The offending index is 0), I find that the reason why the error occur is the size of the model input is unsuitable, so when they cat each other after decoder, the size will be unequal.

My solution is change 8 to 16 in utils/dataprocessor.py, line 99 & line 100. After that, the size can be equal after a serier of decoder.

My solution may not be the best, so I wish you to fix this bug, Thanks~

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.