Created
May 20, 2021 16:05
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SemanticSegmentationPostprocess(Postprocess): | |
def per_sample_transform(self, sample: Any) -> Any: | |
image_original_shape = sample[DefaultDataKeys.METADATA][-2:] | |
resize = K.geometry.Resize(image_original_shape, interpolation='nearest') | |
sample[DefaultDataKeys.PREDS] = resize(torch.stack(sample[DefaultDataKeys.PREDS])) | |
return super().per_sample_transform(sample) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment