PingoLH / FCHarDNet

Fully Convolutional HarDNet for Segmentation in Pytorch
MIT License
195 stars 52 forks source link

Black image after testing on custom image #58

Closed MBKS1 closed 3 years ago

MBKS1 commented 3 years ago

Hello, After the training & validation of HardNet on Cityscapes, I wanted to test the model on some custom images. The script doesnt return any errors but the result is always a black image.

Did anyone encounter this issue ? How can I fix it ?

Thanks,

animesh-007 commented 3 years ago

You can try to use the same method used in validate.py in test.py to solve this issue.

MBKS1 commented 3 years ago

@animesh-007 thanks for your reply.

I fixed the issue by changing the following :

rgb[:,:,0] = r / 255.0 rgb[:,:,1] = g / 255.0 rgb[:,:,2] = b / 255.0

to

rgb[:,:,0] = r rgb[:,:,1] = g rgb[:,:,2] = b

in the Cityscapes Loader (FCHarDNet/ptsemseg/loader/cityscapes_loader.py).