code: def test_inference_mask_generation_one_box(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_boxes = [[[75, 275, 1725, 850]]]
  
      inputs = processor(
          images=raw_image, input_boxes=input_boxes, return_tensors="pt"
      ).to(torch_device)
  
      with torch.no_grad():
          outputs = model(**inputs)
      scores = outputs.iou_scores.squeeze()
      self.assertTrue(
          torch.allclose(scores[-1], torch.tensor(0.7937), 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 9 for calling the SamModelIntegrationTest obj's underlying member method code with example usage: obj.test_inference_mask_generation_one_box() without return types