dmarnerides / hdr-expandnet

Training and inference code for ExpandNet
Other
201 stars 40 forks source link

results in shadows #2

Closed Jee-King closed 6 years ago

Jee-King commented 6 years ago

Hi,Why are shadows appearing in the test results?(as shown below) I didn't find the reason for the shadow in the codes. Thanks in advance! test_indoor

dmarnerides commented 6 years ago

Hey, what do you mean by shadows? Is it the band on the right and bottom? Also, can you include your input image?

Jee-King commented 6 years ago

Hi, thank you for your reply. The shadow I said means that the square inside looks darker. input 00999999-4-inputs 1

output test_indoor

dmarnerides commented 6 years ago

Hm.. I just ran it and the .hdr output looks fine. Did you use any other arguments when you ran it?

dmarnerides commented 6 years ago

This is the (reinhard) tone mapped prediction I get.

prediction_reinhard

Which version of PyTorch are you using?

Jee-King commented 6 years ago

I did not use other arguments. I run this code according to the Readme, and the instruction is _python expand.py ldrinput.jpg And I am using the version of PyTorch is 0.3.1

dmarnerides commented 6 years ago

This is weird. I am using version '1.0.0a0+bcb62cb' of PyTorch but things shouldn't be any different for torch > 0.3.

How are you creating the tone mapped version of the prediction that you attach here?

Jee-King commented 6 years ago

I think this problem has nothing to do with the tone mapping operator. I tried the function tonemap in MATLAB, and there will still be obvious boundaries(as shown below). tone1

dmarnerides commented 6 years ago

I just installed a new environment with PyTorch 0.3.1 and I couldn't reproduce the problem. Have you tried rerunning it? It kinda looks like the operation was stopped midway.

Jee-King commented 6 years ago

Thank you very much, you are an enthusiastic person!! I used pip install OpenCV not conda install opencv -c menpo. Does this have an impact on results?

dmarnerides commented 6 years ago

No worries. Yeah that could cause some problems but I don't think that that's the problem in this case. Can you reproduce this effect if you run it for a second time?

Jee-King commented 6 years ago

I ran it for a second time and tested other inputs. It still has problem with boundaries. input 00999999-5-inputs output indoor2

input 00999999-6-inputs

output indoor3

dmarnerides commented 6 years ago

does the problem remain if you use a different patch size? e.g. python expand.py img.jpg --patch_size 128

Jee-King commented 6 years ago

It seems smaller 55

dmarnerides commented 6 years ago

It looks like there might be a bug with the patch indexing, I'll try and reproduce it/figure it out some time later today.

dmarnerides commented 6 years ago

In the meantime, can you email me the actual images you are using as inputs? There might be some downsampling going on in the ones attached here. Or jist let me know the original dimensions

Jee-King commented 6 years ago

Ok. Thanks again.

dmarnerides commented 6 years ago

Hey, I managed to reproduce the effect and i think i fixed it. Can you please try again and let me know?

Jee-King commented 6 years ago

The boundary still exists. And I use python2.7 which not support print(,end=''), but it will not affect the results.

dmarnerides commented 6 years ago

Hey, you should have opened with that :). Python 2.7 was not supported, but you are right, it wasn't mentioned anywhere.

I managed to reproduce exactly what you had in a Python 2.7 environment. The problem was division (and printing). I added the imports and it should work now. Please let me know.

Jee-King commented 6 years ago

Hi, It works now! Thank you very much! So the problem was division because of python vision. Thanks again! (reinhard) indoor1_prediction_reinhard

dmarnerides commented 6 years ago

No worries, glad to help!