Assuming you are dealing with 21 classes and the current output contains the logits, you could get the predicted class indices via preds = torch.argmax(output, dim=0), where output would have the shape [21, 144, 256]. Once this is done you could then map the class indices to colors and transform the prediction to an RGB image.