Learning-to-See-in-the-Dark icon indicating copy to clipboard operation
Learning-to-See-in-the-Dark copied to clipboard

Output is all black

Open stephenlamis opened this issue 5 years ago • 15 comments

I got the pretrain checkpoints and run test_Fuji All result output are just black. Verified in multiple setup. Is there any problem on the Pretrain model?

Also what is the purpose of those gt files under result? Seems they are from the long exposure images

stephenlamis avatar Mar 18 '19 15:03 stephenlamis

Normally, you got black images because the pretrained model is not loaded correctly.

GT images are from long exposure raw data, used as reference.

cchen156 avatar Mar 18 '19 17:03 cchen156

Just realised I need to have those files : checkpoint, model.ckpt.index under the checkpoint folder Now I have it working . Thx!

stephenlamis avatar Mar 19 '19 04:03 stephenlamis

@stephenlamis I have the same problem with . I used the Sony test data. But the output result is all black.could you please tell me . where is the correct pretrained model. Thank you very much.

yanmenglu avatar Mar 27 '19 09:03 yanmenglu

follow the instructions clone the repository and simply run python download_models.py then the checkpoint will be updated to the right place.

stephenlamis avatar Apr 07 '19 03:04 stephenlamis

My output is all black but the difference is that I am trying my own .RAF file taken with a Fuji camera with different exposures.

Any idea of why this could be happening? I am not getting this issue when testing the model with the dataset provided, so I believe it has not to do with the pretrained model loaded incorrectly.

anaquio avatar May 29 '19 08:05 anaquio

I remembered there is some sort of filename convention to state the exposure time. This is being used as a parameter input (it's state in the paper that it's one of the external dependence value). Try to follow the naming convention from those testing sample.

stephenlamis avatar May 29 '19 09:05 stephenlamis

@stephenlamis yes, there is, and I used exactly the same, that's why I am confused that the output is completely black...

anaquio avatar May 29 '19 12:05 anaquio

How are you normalizing your photos? Do you know for sure their black level and bit depth is 2 ** 10 and 14 bits respectively?

cardoso-neto avatar Jun 03 '19 12:06 cardoso-neto

@cardoso-neto I don't, how can I check it?

anaquio avatar Jun 03 '19 15:06 anaquio

Read the image with rawpy and check it.

>>> import rawpy
>>> pic = rawpy.imread('long/00001_00_10s.ARW')
>>> pic.black_level_per_channel
[512, 512, 512, 512]
>>> np.max(pic.raw_image)
16383

RawPy's documentation: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html

cardoso-neto avatar Jun 05 '19 20:06 cardoso-neto

Thank you very much @cardoso-neto. I have done what you suggested with an image of my own and why the black level per channel is [512, 512, 512, 512], when I do np.max(pic.raw_image) I get 4095instead of 16383.

Does this have something to do with the fact of the model not being able to bright my image?

anaquio avatar Jun 06 '19 10:06 anaquio

Perhaps. Try it out. That np.max strategy to find out bit depth is not the best, but it often works. At least you figured out your black level. From there, I'd just try a few different bit depths, starting with the one you got (2 ** 12 - 1). And don't worry, you'll definitely know if you've got the correct one just by looking at the output image.

cardoso-neto avatar Jun 06 '19 10:06 cardoso-neto

And by the way, yes that's got everything to do with your black image. You're normalizing the picture as if it were 14 bits and its black level were 1024 (assuming you're using the Fuji Dataset class). One can easily see that the input to the network will be all zeros. Try it out with the new values. It'll probably work now.

cardoso-neto avatar Jun 06 '19 10:06 cardoso-neto

hello @anaquio , were you able to fix the max value issue? what was the strategy you followed? @cardoso-neto I am a novice in image processing and my question may be silly, but as far as I understand, np.max will give the value of the brightest pixel in the short exposed image. wouldn't this be too low as compared to the bit depth used in the camera (which always will be 2^14)? If so, is there any way to retireve the capturing bit-depth? Please correct me if wrong.

KashyapCKotak avatar Jul 25 '19 14:07 KashyapCKotak

I am in China. I cannot download the pre-trained model from google linkone. Can some please help me to get the pre-trained model. thanks.

tahirrasheeed avatar May 18 '20 01:05 tahirrasheeed