After applying the Resize transform to the binary mask, we get a non-binary mask:
In: np.unique(mask), mask.shape
Out: (array([ 0, 255], dtype=uint8), (101, 101))
In: t_mask = Resize(256, 256)(image=img, mask=mask)['mask']
In: np.unique(t_mask), t_mask.shape
Out: (array([ 0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13,
14, 15, 17, 18, 20, 22, 23, 24, 25, 26, 27, 29, 32,
33, 34, 35, 36, 37, 38, 40, 42, 43, 44, 48, 50, 52,
53, 54, 55, 56, 57, 58, 60, 61, 62, 65, 66, 68, 69,
72, 74, 75, 79, 81, 82, 83, 84, 86, 87, 88, 89, 90,
91, 93, 94, 95, 96, 100, 103, 111, 112, 118, 119, 120, 121,
126, 132, 133, 134, 135, 136, 137, 138, 141, 142, 143, 144, 147,
151, 154, 155, 156, 158, 159, 162, 164, 165, 166, 167, 168, 169,
173, 179, 180, 181, 182, 183, 186, 187, 190, 193, 194, 195, 196,
197, 199, 201, 205, 207, 208, 212, 213, 215, 216, 217, 220, 221,
222, 223, 224, 226, 227, 228, 229, 232, 233, 234, 235, 236, 237,
238, 239, 240, 242, 243, 244, 245, 246, 250, 251, 252, 253, 254,
255], dtype=uint8), (256, 256))