code: def test_post_processing_semantic_segmentation(self):
      feature_extractor = DPTFeatureExtractor.from_pretrained(
          "Intel/dpt-large-ade"
      )
      model = DPTForSemanticSegmentation.from_pretrained(
          "Intel/dpt-large-ade"
      ).to(torch_device)
  
      image = prepare_img()
      inputs = feature_extractor(images=image, return_tensors="pt").to(
          torch_device
      )
  
      # forward pass
      with torch.no_grad():
          outputs = model(**inputs)
  
      outputs.logits = outputs.logits.detach().cpu()
  
      segmentation = (
          feature_extractor.post_process_semantic_segmentation(
              outputs=outputs, target_sizes=[(500, 300)]
          )
      )
      expected_shape = torch.Size((500, 300))
      self.assertEqual(segmentation[0].shape, expected_shape)
  
      segmentation = (
          feature_extractor.post_process_semantic_segmentation(
              outputs=outputs
          )
      )
      expected_shape = torch.Size((480, 480))
      self.assertEqual(segmentation[0].shape, expected_shape)
  
imports: import inspect
  import unittest
  from transformers import DPTConfig
  from transformers.file_utils import is_torch_available, is_vision_available
  from transformers.models.auto import get_values
  from transformers.testing_utils import require_torch, require_vision, slow, torch_device
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor
label_desc: Use image node_id 3 for calling the DPTModelIntegrationTest obj's underlying member method code with example usage: obj.test_post_processing_semantic_segmentation() without return types