Thank you for your reply.
Maybe I was not clear enough. The problem I have is, how do I turn the output from the network into a binary prediction image? I think you indirectly answered that with the “pred = pred_prob > 0.5” line of the code you wrote. Is this the usual way; to use softmax and then prob > 0.5 outside of the network?