code: def test_per_sample_dice(segmentation_coco_visiondata_train):
      batch = next(iter(segmentation_coco_visiondata_train))
      res = per_sample_dice(batch["predictions"], batch["labels"])
      assert_that(sum(res), close_to(9.513, 0.001))
  
imports: from typing import Dict
  import numpy
  from hamcrest import assert_that, close_to, has_items, has_length
  from ignite.engine import Engine
  from ignite.metrics import Metric
  from numpy import nanmean
  from sklearn.metrics import jaccard_score, make_scorer
  from deepchecks.vision import VisionData
  from deepchecks.vision.metrics_utils import get_scorers_dict
  from deepchecks.vision.metrics_utils.detection_precision_recall import ObjectDetectionAveragePrecision
  from deepchecks.vision.metrics_utils.semantic_segmentation_metrics import MeanDice, MeanIoU, per_sample_dice
  from deepchecks.vision.vision_data.utils import sequence_to_numpy
label_desc: Use image node_id 8 for calling a global function with example usage: test_per_sample_dice(segmentation_coco_visiondata_train) without return types