Hi all,
I have a dataset of masks for semantic segmentation.
The masks are .png
files, and each pixel of them can have 3 values [1, 2, 255]. The native mode of the masks’ files is mode-P
.
Once I read these files with Fastai
, I noted that resulted 4 values [0, 76, 242, 255].
I suspect that it is due to the fact that PIL
read files in mode-L
instead of mode-P
.
As suggested here, I tried to override the specific class by:
class PILMask(PILBase): _open_args,_show_args = {'mode':'P'},{'alpha':0.5, 'cmap':'tab20'}
but it does not seem to work with DataBlock(...)
.