Pass your input to the model and return the logits:

outputs = model(pixel_values=pixel_values)
logits = outputs.logits.cpu()

Next, rescale the logits to the original image size:

upsampled_logits = nn.functional.interpolate(
     logits,
     size=image.size[::-1],
     mode="bilinear",
     align_corners=False,
 )
pred_seg = upsampled_logits.argmax(dim=1)[0]

Load an image processor to preprocess the image and return the input as TensorFlow tensors: