Implementing a U-Net from scratch
It's difficult to talk about image segmentation without mentioning U-Net, one of the seminal architectures when it comes to pixel-wise classification.
A U-Net is a composite network comprised of an encoder and a decoder, whose layers, as the name suggests, are arranged in a U shape. It's intended for fast and precise segmentation, and in this recipe, we'll implement one from scratch.
Let's get started, shall we?
Getting ready
In this example, we'll rely on several external libraries, such as TensorFlow Datasets, TensorFlow Docs, Pillow
, and OpenCV
. The good news is that we can easily install them all with pip
. First, install tensorflow_docs
, as follows:
$> pip install git+https://github.com/tensorflow/docs
Next, install the remaining libraries:
$> pip install tensorflow-datasets Pillow opencv-contrib-python
We will be using Oxford-IIIT Pet Dataset
in this recipe. However, we don't need to...