code: def _test_common_mmdet_mask_batch(batch):
      data, recs = batch
  
      assert set(data.keys()) == {
          "gt_bboxes",
          "gt_labels",
          "gt_masks",
          "img",
          "img_metas",
      }
      assert (
          (np.array(recs[0].detection.label_ids) - 1)
          == data["gt_labels"][0].numpy()
      ).all()
      assert data["img_metas"][0]["img_shape"] == (4, 4, 3)
      assert (
          data["img_metas"][0]["scale_factor"]
          == np.array([1.0, 1.0, 1.0, 1.0])
      ).all()
      assert "BitmapMasks" in str(type(data["gt_masks"][0]))
      assert len(data["gt_masks"]) == 2
      assert (
          data["gt_masks"][0].height == data["gt_masks"][0].width == 4
      )
  
      rec = recs[0]
      assert isinstance(rec.detection.label_ids, list)
      assert isinstance(rec.detection.bboxes[0], BBox)
      assert isinstance(rec.detection.mask_array, MaskArray)
      assert isinstance(rec.height, int)
      assert isinstance(rec.width, int)
      assert isinstance(rec.record_id, int)
      assert isinstance(rec.img, np.ndarray)
  
file_path: icevision/tests/models/mmdet/test_dataloaders.py
imports: import pytest
  from icevision.all import *
label_desc: Use image node_id 8 for calling a global function with example usage: _test_common_mmdet_mask_batch(batch) without return types