In the two final Jupyter notebooks for this chapter, FCN and U-Net models are trained to tackle this task, using several of the tricks presented in this section. We demonstrate how to properly weigh each class when computing the loss, we present how to post-process the label maps, and more besides.
As the whole solution is quite long and notebooks are better suited to the present code, we invite you to pursue the reading there, if you're interested in this use case. This way, we can dedicate the rest of this chapter to another fascinating problem—instance segmentation.