code: def build_train_batch(
      records: Sequence[RecordType],
  ) -> Tuple[dict, List[Dict[str, torch.Tensor]]]:
      images, labels, bboxes, masks, img_metas = [], [], [], [], []
      for record in records:
          images.append(_img_tensor(record))
          img_metas.append(_img_meta_mask(record))
          labels.append(_labels(record))
          bboxes.append(_bboxes(record))
          masks.append(_masks(record))
  
      data = {
          "img": torch.stack(images),
          "img_metas": img_metas,
          "gt_labels": labels,
          "gt_bboxes": bboxes,
          "gt_masks": masks,
      }
  
      return data, records
  
file_path: icevision/icevision/models/mmdet/common/mask/dataloaders.py
imports: from mmdet.core import BitmapMasks
  from icevision.core import *
  from icevision.imports import *
  from icevision.models.utils import *
  from icevision.models.mmdet.common.bbox.dataloaders import _img_tensor, _img_meta, _labels, _bboxes
label_desc: Use image node_id 5 for calling a global function with example usage: build_train_batch(records) and returns: data,  records