src/transformers/models/segformer/image_processing_segformer.py/SegformerImageProcessor/reduce_label
class SegformerImageProcessor:    def reduce_label(self, label: ImageInput) -> np.ndarray:
        label = to_numpy_array(label)
        # Avoid using underflow conversion
        label[label == 0] = 255
        label = label - 1
        label[label == 254] = 255
        return label