Pytorch-UNet icon indicating copy to clipboard operation
Pytorch-UNet copied to clipboard

save image

Open mouxinyue1 opened this issue 2 years ago • 1 comments

Hello, I want to change the saved result image into grayscale rather than binary graph, may I ask what part of the code to modify

mouxinyue1 avatar Feb 13 '23 02:02 mouxinyue1

The image saving is right there in predict.py https://github.com/milesial/Pytorch-UNet/blob/40d5ba797c5689cd9560233baa0e52f28f92727c/predict.py#L62

If you have num_classes > 1 you should remove the argmax in the mask prediction and replace with whatever fits you to convert multiple classes to greyscale. If you have num_classes ==1 you should remove the thresholding in the mask prediction.

milesial avatar Feb 13 '23 03:02 milesial