code: def test_small_model_pt_semantic(self):
      model_id = "hf-internal-testing/tiny-random-beit-pipeline"
      image_segmenter = pipeline(model=model_id)
      outputs = image_segmenter(
          "http://images.cocodataset.org/val2017/000000039769.jpg"
      )
      for o in outputs:
          # shortening by hashing
          o["mask"] = mask_to_test_readable(o["mask"])
  
      self.assertEqual(
          nested_simplify(outputs, decimals=4),
          [
              {
                  "score": None,
                  "label": "LABEL_0",
                  "mask": {
                      "hash": "42d0907228",
                      "shape": (480, 640),
                      "white_pixels": 10714,
                  },
              },
              {
                  "score": None,
                  "label": "LABEL_1",
                  "mask": {
                      "hash": "46b8cc3976",
                      "shape": (480, 640),
                      "white_pixels": 296486,
                  },
              },
          ],
      )
  
imports: import hashlib
  import unittest
  from typing import Dict
  import datasets
  import numpy
  from datasets import load_dataset
  from transformers import MODEL_FOR_IMAGE_SEGMENTATION_MAPPING, MODEL_FOR_INSTANCE_SEGMENTATION_MAPPING, MODEL_FOR_SEMANTIC_SEGMENTATION_MAPPING, AutoFeatureExtractor, AutoModelForImageSegmentation, AutoModelForInstanceSegmentation, DetrForSegmentation, ImageSegmentationPipeline, MaskFormerForInstanceSegmentation, is_vision_available, pipeline
  from transformers.testing_utils import nested_simplify, require_tf, require_timm, require_torch, require_vision, slow
  from .test_pipelines_common import ANY, PipelineTestCaseMeta
label_desc: Use image node_id 6 for calling the ImageSegmentationPipelineTests obj's underlying member method code with example usage: obj.test_small_model_pt_semantic() without return types