code: def test_mmdet_mask_rcnn_build_infer_batch(mask_records):
      batch = models.mmdet.mask_rcnn.build_infer_batch(mask_records)
      data, recs = batch
  
      assert set(data.keys()) == {
          "img",
          "img_metas",
      }
      assert recs[0].detection.label_ids == [1, 2]
      assert data["img_metas"][0][0]["img_shape"] == (4, 4, 3)
      assert (
          data["img_metas"][0][0]["scale_factor"]
          == np.array([1.0, 1.0, 1.0, 1.0])
      ).all()
  
      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 11 for calling a global function with example usage: test_mmdet_mask_rcnn_build_infer_batch(mask_records) without return types