elliottwu / DeepHDR

This is the implementation for Deep High Dynamic Range Imaging with Large Foreground Motions (ECCV'18)
MIT License
186 stars 38 forks source link

difference of PSNR #11

Closed Carrotor116 closed 4 years ago

Carrotor116 commented 4 years ago

Hi, thanks for your work. I have a problem about the PNSR in your work. the code about psnr is following one in mode.py

            curr_psnr = [compute_psnr(tonemap_np(res_samples[i]), tonemap_np(batch_ref_HDR[i])) for i in range(batchSz)]

I understand it is calculation of PNSR_T. While I tested the pretrained model in Kalantari's dataset and got a average PSNR_T (41.9977) which is different of the PSNR_T in your paper (40.81 for unet ver. and 41.65 for resnet ver.). I wonder if this is normal or the code of calculate PSNR_T is something other?

The detail of my testing in following:

First I cloned the projection and downloaded the pretrained model and Kalantari's dataset (from the link in readme.md) Then I have the test dataset and pretrained model

$ ls  dataset/test
001  002  003  004  005  006  007  008  009  010  BarbequeDay  LadySitting  ManStanding  PeopleStanding  PeopleTalking
$ ls pretrained_ckp/
checkpoint  pretrained.data-00000-of-00001  pretrained.index  pretrained.meta

I made a test by the command

$ CUDA_VISIBLE_DEVICES=3 python test.py --dataset ./dataset/test --num_shots 3 --checkpoint_dir pretrained_ckp --batch_size 1 --results_dir results_pretrained --test_h 960 --test_w 1440

the log is following:

$ CUDA_VISIBLE_DEVICES=3 python test.py --dataset ./dataset/test --num_shots 3 --checkpoint_dir pretrained_ckp --batch_size 1 --res
ults_dir results_pretrained --test_h 960 --test_w 1440
2019-11-30 14:11:41.696733: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 AVX512F FMA
2019-11-30 14:11:43.051910: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1344] Found device 0 with properties:
name: Tesla V100-PCIE-16GB major: 7 minor: 0 memoryClockRate(GHz): 1.38
pciBusID: 0000:db:00.0
totalMemory: 15.78GiB freeMemory: 15.36GiB
2019-11-30 14:11:43.051957: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1423] Adding visible gpu devices: 0
2019-11-30 14:11:43.606928: I tensorflow/core/common_runtime/gpu/gpu_device.cc:911] Device interconnect StreamExecutor with strength 1 edge matrix:
2019-11-30 14:11:43.606977: I tensorflow/core/common_runtime/gpu/gpu_device.cc:917]      0
2019-11-30 14:11:43.606986: I tensorflow/core/common_runtime/gpu/gpu_device.cc:930] 0:   N
2019-11-30 14:11:43.607332: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1041] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 14877 MB memory) -> physical GPU (device: 0, name: Tesla V100-PCIE-16GB, pci bus id: 0000:db:00.0, compute capability: 7.0)
WARNING:tensorflow:From /data/nonu_data/pyvenv/.venv/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/datasets/base.py:198: retry (from tensorflow.contrib.learn.python.learn.datasets.base) is deprecated and will be removed in a future version.
Instructions for updating:
Use the retry module or similar alternatives.
WARNING:tensorflow:From /data/nonu_data/pyvenv/.venv/lib/python3.5/site-packages/tensorflow/python/util/tf_should_use.py:118: initialize_all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2017-03-02.
Instructions for updating:
Use `tf.global_variables_initializer` instead.
 [*] Reading checkpoints...
batch no. 1:
time: 4.8884
PSNR: 48.6350

batch no. 2:
time: 0.7845
PSNR: 44.5190

batch no. 3:
time: 0.2106
PSNR: 41.9392

batch no. 4:
time: 0.2477
PSNR: 42.9087

batch no. 5:
time: 0.2121
PSNR: 43.0685

batch no. 6:
time: 0.2460
PSNR: 38.9594

batch no. 7:
time: 0.2231
PSNR: 39.3789

batch no. 8:
time: 0.2155
PSNR: 34.9346

batch no. 9:
time: 0.2113
PSNR: 42.4318

batch no. 10:
time: 0.2115
PSNR: 37.4935

batch no. 11:
time: 0.2123
PSNR: 39.1859

batch no. 12:
time: 0.2146
PSNR: 41.9842

batch no. 13:
time: 0.2251
PSNR: 49.1725

batch no. 14:
time: 0.2523
PSNR: 43.7752

batch no. 15:
time: 0.2158
PSNR: 41.5797

Average PSNR: 41.9977
elliottwu commented 4 years ago

Hi, Thanks for the detailed description. Yes, it is the code for computing the PSNR of tonemapped predictions. The released model is a slightly improved version. Feel free to mention both numbers for comparison.

Carrotor116 commented 4 years ago

Hi, Thanks for the detailed description. Yes, it is the code for computing the PSNR of tonemapped predictions. The released model is a slightly improved version. Feel free to mention both numbers for comparison.

Thanks for your reply. So your work is real well :)