| S | Four channels |
This page is a supplementary material for those who are interested in exploring more.
Did you wonder, whether it is possible to train a model with all four channels? Well, it is possible! However, we need to make some adaptations to our codes. We will only give you the hints here, since most of the codes stay the same.
- It is recommended to change your
rootDir, so that you do not overwrite the files with three channels. - There is, of course, no need anymore to subset to three channels.
- The mask files stay the same, since the extent is not changed.
- In our function
spectral_augmentation(), the functiontf$image$random_saturation()only accepts three channels. This can be seen in the Python TensorFlow reference. For simplicity, let us just removerandom_saturationfrom our function. - In our function
get_unet_128(), change theinput_shapetoc(128, 128, 4).
That is it! Happy coding :)
If this raised your interest, you may also have a look into this thesis on GitHub, which also started from modifying codes in this course and is able to train images with any number of channels.
Comments?
You can leave comments under this Issue if you have questions or remarks about any of the code chunks that are not included as gist. Please copy the corresponding line into your comment to make it easier to answer the question.