[Solved]Binary Mask Issue

So, I have separated the ‘person’ segmentation from the coco dataset. But it seems to me, each image has more than 2 values. But I want the masking to be only zero and one. Can I do custom masking? So, suppose I have value zero, I will keep the value to zero or other than that all value to mask 1?

you can try something like

img = PILMask.create(filename)
data = np.array(img)
data = np.where(data > 1, 1, data ) 

and save if needed.

I have attached the images, can you tell where should I make the necessary change to fit it in the data bunch?

I solved the problem