Resizing semantic segmentation labels

See this if you are doing resize in data loading. Otherwise I often convert the segmentation mask to float and then torch.nn.functional.interpolate(mask, $TARGET_SHAPE, mode='nearest') and finally convert it back to long.