Creating a fully convolutional network for image segmentation
If you were to create your first network for image segmentation while knowing that, at its core, segmenting is just pixel-wise classification, what would you do? You would probably take a battle-tested architecture and swap the final layers (usually fully connected ones) with convolutions in order to produce an output volume, instead of an output vector.
Well, that's exactly what we'll do in this recipe to build a Fully Convolutional Network (FCN) for image segmentation based on the famous VGG16 network.
Let's get started!
Getting ready
We need to install a couple of external libraries, starting with tensorflow_docs
:
$> pip install git+https://github.com/tensorflow/docs
Next, we need to install TensorFlow Datasets, Pillow
, and OpenCV
:
$> pip install tensorflow-datasets Pillow opencv-contrib-python
Regarding the data, we will segment images from the Oxford-IIIT Pet
dataset. The...