You’d need to do two labels, (just like CamVid). But you need to be sure that your mask only has the 2 you want (0 and 1) for pixels. If not that’s not a fastai issue that’s a dataset issue. There’s a post discussing how to see how many total classes there are in a segmentation dataset, I’ll try to find it.
Struggling with this. I have a binary mask with two values (0 and 255) I found that IntToFloatTensor(div_mask=255) should be the one function that returns the proper mask but I am still getting an AssertionError when trying to lr_find(). When trying:
EDIT
Seems that I found the issue. Looking at MaskBlockI found that there is a batch_tfms there:
def MaskBlock(codes=None):
"A `TransformBlock` for segmentation masks, potentially with `codes`"
return TransformBlock(type_tfms=PILMask.create, item_tfms=AddMaskCodes(codes=codes),
batch_tfms=IntToFloatTensor())
Adding IntToFloatTensor(div_mask=255) do the trick