How can I display only the edges in semantic segmentation?

The model could predict the classes as shown in the attached image; I was wondering how is it possible to display only the edges of the predicted objcet?
the image is the probability map of output.

    outputs = model(t_image)
    prob = torch.exp(outputs)
    prob_imgs = make_grid(prob.permute(1, 0, 2, 3))
    prob_imgs = prob_imgs.detach()
    plt.imshow(prob_imgs.permute(1, 2, 0))


Hi @Neda, maybe try binarizing the output?

An edge detector can also be applied to the image.

1 Like

@Antonio_Rueda_Toicen Thank you for the link. I will have a look.