In the same way as any other machine learning problem, the first step is getting the data. Since semantic segmentation is a supervised learning task, we need a classification dataset of images and corresponding labels. The peculiarity is that the label in itself is an image.
At the time of writing, there is no semantic dataset ready to use in TensorFlow Datasets. For this reason, we use this section not only to create tf.data.Dataset with the data that we need, but also to have a look at the process required to develop a tfds DatasetBuilder.
Since, in the previous section dedicated to the object detection, we used the PASCAL VOC 2007 dataset, we are going to reuse the downloaded files to create the semantic segmentation version of the PASCAL VOC 2007 dataset. The following screenshot shows how the dataset is provided. Each picture has a corresponding...