zhixuhao / unet

unet for image segmentation
MIT License
4.6k stars 2k forks source link

Output images are grey when tested on zhixuhao's dataset #129

Open hebbarashwin opened 5 years ago

hebbarashwin commented 5 years ago

I have used the training and test images provided by zhixuhao.

I've also used the same code provided here, except a small change in data.py : (Changed 'train_generator = zip(image_generator, mask_generator)' to: 'train_generator = itertools.izip(image_generator, mask_generator)' )

But the predicted outputs are grey images. I am getting a warning : UserWarning: data/membrane/test/29_predict.png is a low contrast image

Are there any bugs in the code? I'm using Python 2.7.12, and Keras 2.2.4

fadishaar84 commented 5 years ago

I have the same problem, did you manage to solve it?

amorrissette commented 5 years ago

See my comment in #132 - in summary this is supposed to happen since the final layer of the model is a sigmoid function. You just need to threshold these value to generate a binary image of 0s and 1s