code: def test_post_processing_semantic_segmentation(self):
      model = MobileViTV2ForSemanticSegmentation.from_pretrained(
          "shehan97/mobilevitv2-1.0-voc-deeplabv3"
      )
      model = model.to(torch_device)
  
      image_processor = MobileViTImageProcessor.from_pretrained(
          "shehan97/mobilevitv2-1.0-voc-deeplabv3"
      )
  
      image = prepare_img()
      inputs = image_processor(images=image, return_tensors="pt").to(
          torch_device
      )
  
      # forward pass
      with torch.no_grad():
          outputs = model(**inputs)
  
      outputs.logits = outputs.logits.detach().cpu()
  
      segmentation = image_processor.post_process_semantic_segmentation(
          outputs=outputs, target_sizes=[(50, 60)]
      )
      expected_shape = torch.Size((50, 60))
      self.assertEqual(segmentation[0].shape, expected_shape)
  
      segmentation = image_processor.post_process_semantic_segmentation(
          outputs=outputs
      )
      expected_shape = torch.Size((32, 32))
      self.assertEqual(segmentation[0].shape, expected_shape)
  
imports: import unittest
  from transformers import MobileViTV2Config
  from transformers.testing_utils import require_torch, require_torch_multi_gpu, require_vision, slow, torch_device
  from transformers.utils import cached_property, is_torch_available, is_vision_available
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor
  from ...test_pipeline_mixin import PipelineTesterMixin
label_desc: Use image node_id 4 for calling the MobileViTV2ModelIntegrationTest obj's underlying member method code with example usage: obj.test_post_processing_semantic_segmentation() without return types