deep-spectral-segmentation icon indicating copy to clipboard operation
deep-spectral-segmentation copied to clipboard

Add a line to retransform output image

Open mraoaakash opened this issue 2 years ago • 2 comments

Hello!

While running your code on my dataset, I noticed your CRF output was not being displayed correctly. I realised that this was an error between line 688 and 694. You were computing the correct CRF, however, since it was a binary array generated you need to multiply it by 255 to have the appropriate image pixel values generated. Convert('L') does not seem to be having a desired effect on MacOS and Linux with an Nvidia A5000 (the bases on which I have tested your code). I hope this addition is valuable to your code and subsequent research.

Best, Aakash

mraoaakash avatar Jan 04 '23 08:01 mraoaakash

Should this be segmap_crf = (segmap_crf * 255).astype(np.uint8)?

I suppose if segmap_crf is binary than it doesn't matter, but if it is not binary and it takes values between 0 and 1 then they will get truncated when it gets casted to uint8.

lukemelas avatar Jan 12 '23 21:01 lukemelas

Yes, the correction should be segmap_crf = (segmap_crf * 255).astype(np.uint8)

mraoaakash avatar Jan 13 '23 05:01 mraoaakash