Does anyone know how can I save the output of predicted class labels of each pixel in FCN semantic segmentation? I would like to see the probability map of the image during inference. The data in which layer should be saved?
Many thanks
Does anyone know how can I save the output of predicted class labels of each pixel in FCN semantic segmentation? I would like to see the probability map of the image during inference. The data in which layer should be saved?
Many thanks
As you can see from the code in infer.py
the predicted label is argmax
of 'score'
layer.
out = net.blobs['score'].data[0].argmax(axis=0)
The 'score'
is the input to "SoftmaxWithLoss"
layer during training. Hence, to get class probabilities from 'score'
you need to add "Softmax"
on top of 'score'
:
e_s = np.exp(net.blobs['score'].data[0])
prob = e_s / e_s.sum(axis=0)