Your images are gray scale 8 bit. That means you have two options how to load and process them.
dataSource = SegmentationItemList.from_folder(path_images, convert_mode='RGB')
The important part here is “convert_mode”. “RGB” is the default. For gray scale images this means it just copies the values of an image to each channel and works on them as they were RGB. This way you can use pre-trained ImageNet from a statistical and dimensional point of view. However, this does not always work meaningfully, especially for medical images I have seen problems there. You have to basically test it.
The alternative is to set the value to “L”. Then you will work on single channel images, which also means you can’t use pre-trained ImageNet. Nevertheless, you should normalize the data with
This takes your data statistics for normalization and training starts with randomly initialized weights. Best use Xavier or Kaiming initialization. You can have a look here:
You can set it via
yourLearner.init = torch.nn.init.XXX
Regarding the tfm_y it depends. Imagine you rotate the image bi some degree, then you also want the mask to be rotated. So in general I recommend to set it to True. Only if you exactly know what you are doing and why, it can make sense to set it to False.
Out of interest, what exactly are you learning / doing? Is it for some project or a paper or something else?