Wolfram Language

Segment Images Semantically

Semantic segmentation is a high-level task that is quintessential to scene understanding: applications include self-driving vehicles, virtual reality, human-computer interaction, etc. While image classification makes a prediction for the entire image, semantic segmentation aims to classify each pixel of the image into constituent classes. This example shows how to use a pre-trained image segmentation net. This model can also be fine-tuned to specific data using NetTrain.

Obtain a pre-trained net from the Neural Net Repository and copy the evaluation function from its resource page.

Define the label list for this model. Integers in the model's output correspond to elements in the label list.

Write a function to visualize each pixel according to its segmentation class, and overlay the segmentation on top of the original image. While not perfect, you can see that most objects have been correctly segmented.

Related Examples

de es fr ja ko pt-br zh