code: def test_inference_mask_generation_two_points_batched(self):
      model = SamModel.from_pretrained("facebook/sam-vit-base")
      processor = SamProcessor.from_pretrained("facebook/sam-vit-base")
  
      model.to(torch_device)
      model.eval()
  
      raw_image = prepare_image()
  
      input_points = [[[400, 650], [800, 650]], [[400, 650]]]
      input_labels = [[1, 1], [1]]
  
      inputs = processor(
          images=[raw_image, raw_image],
          input_points=input_points,
          input_labels=input_labels,
          return_tensors="pt",
      ).to(torch_device)
  
      with torch.no_grad():
          outputs = model(**inputs)
      scores = outputs.iou_scores.squeeze()
      self.assertTrue(
          torch.allclose(scores[0][-1], torch.tensor(0.9762), atol=1e-4)
      )
      self.assertTrue(
          torch.allclose(scores[1][-1], torch.tensor(0.9637), atol=1e-4)
      )
  
imports: import gc
  import unittest
  import requests
  from transformers import SamConfig, SamMaskDecoderConfig, SamPromptEncoderConfig, SamVisionConfig, pipeline
  from transformers.testing_utils import backend_empty_cache, require_torch, slow, torch_device
  from transformers.utils import is_torch_available, is_vision_available
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, floats_tensor
  from ...test_pipeline_mixin import PipelineTesterMixin
label_desc: Use image node_id 8 for calling the SamModelIntegrationTest obj's underlying member method code with example usage: obj.test_inference_mask_generation_two_points_batched() without return types