of line 71, 72 in build_data.py, why label need multiply 255,
for example if label mask is
[[0, 2, 2, 3, 1],
[0, 2, 2, 2, 1],
[255, 3, 3, 255]], class is [0, 1, 2, 3], 255 denotes ignore class.
"""
label = (transforms_f.to_tensor(label) * 255).long()
label[label == 255] = -1 # invalid pixels are re-mapped to index -1
"""
The transform_f function will automatically renomalise data to the range of 0 - 1. You can verify this by loading a random label image from the dataset folder, and call transform_f.
of line 71, 72 in build_data.py, why label need multiply 255,
for example if label mask is [[0, 2, 2, 3, 1], [0, 2, 2, 2, 1], [255, 3, 3, 255]], class is [0, 1, 2, 3], 255 denotes ignore class. """ label = (transforms_f.to_tensor(label) * 255).long() label[label == 255] = -1 # invalid pixels are re-mapped to index -1 """