code: def test_post_process_semantic_segmentation(self):
      fature_extractor = self.image_processing_class(
          num_labels=self.image_processor_tester.num_classes,
          max_seq_length=77,
          task_seq_length=77,
          class_info_file="ade20k_panoptic.json",
          num_text=self.image_processor_tester.num_text,
          repo_path="shi-labs/oneformer_demo",
      )
      outputs = self.image_processor_tester.get_fake_oneformer_outputs()
  
      segmentation = (
          fature_extractor.post_process_semantic_segmentation(outputs)
      )
  
      self.assertEqual(
          len(segmentation), self.image_processor_tester.batch_size
      )
      self.assertEqual(
          segmentation[0].shape,
          (
              self.image_processor_tester.height,
              self.image_processor_tester.width,
          ),
      )
  
      target_sizes = [
          (1, 4) for i in range(self.image_processor_tester.batch_size)
      ]
      segmentation = (
          fature_extractor.post_process_semantic_segmentation(
              outputs, target_sizes=target_sizes
          )
      )
  
      self.assertEqual(segmentation[0].shape, target_sizes[0])
  
imports: import json
  import os
  import tempfile
  import unittest
  import numpy
  from transformers.testing_utils import require_torch, require_vision
  from transformers.utils import is_torch_available, is_vision_available
  from ...test_image_processing_common import ImageProcessingTestMixin, prepare_image_inputs
label_desc: Use image node_id 8 for calling the OneFormerImageProcessingTest obj's underlying member method code with example usage: obj.test_post_process_semantic_segmentation() without return types