code: def test_cardinality(self, device, batch_size, N, multimask_output):
      # SAM: don't supports float64
      dtype = torch.float32
      inpt = torch.rand(3, 77, 128, device=device, dtype=dtype)
      prompter = VisualPrompter(SamConfig("vit_b"), device, dtype)
  
      keypoints = torch.randint(
          0, min(inpt.shape[-2:]), (batch_size, N, 2), device=device
      ).to(dtype=dtype)
      labels = torch.randint(0, 1, (batch_size, N), device=device).to(
          dtype=dtype
      )
  
      prompter.set_image(inpt)
  
      out = prompter.predict(
          keypoints, labels, multimask_output=multimask_output
      )
  
      C = 3 if multimask_output else 1
      assert out.logits.shape == (batch_size, C, 256, 256)
      assert out.scores.shape == (batch_size, C)
  
file_path: kornia/test/contrib/test_prompter.py
imports: import pytest
  import torch
  from kornia.contrib.models.sam import SamConfig
  from kornia.contrib.visual_prompter import VisualPrompter
  from kornia.testing import BaseTester
label_desc: Use image node_id 2 for calling the TestVisualPrompter obj's underlying member method code with example usage: obj.test_cardinality(device, batch_size, N, multimask_output) without return types