code: def test_image_processor_with_masks(self):
      image_processor = self.get_image_processor()
  
      processor = SamProcessor(image_processor=image_processor)
  
      image_input = self.prepare_image_inputs()
      mask_input = self.prepare_mask_inputs()
  
      input_feat_extract = image_processor(
          images=image_input,
          segmentation_maps=mask_input,
          return_tensors="np",
      )
      input_processor = processor(
          images=image_input,
          segmentation_maps=mask_input,
          return_tensors="np",
      )
  
      for key in input_feat_extract.keys():
          self.assertAlmostEqual(
              input_feat_extract[key].sum(),
              input_processor[key].sum(),
              delta=1e-2,
          )
  
      for label in input_feat_extract.labels:
          self.assertEqual(label.shape, (256, 256))
  
imports: import shutil
  import tempfile
  import unittest
  import numpy
  from transformers.testing_utils import is_pt_tf_cross_test, require_tf, require_torch, require_torchvision, require_vision
  from transformers.utils import is_tf_available, is_torch_available, is_vision_available
label_desc: Use image node_id 8 for calling the SamProcessorTest obj's underlying member method code with example usage: obj.test_image_processor_with_masks() without return types