code: def mask_dls_model(coco_mask_records, samples_source):
      train_records, valid_records = (
          coco_mask_records[:2],
          coco_mask_records[:1],
      )
  
      presize, size = 256, 128
      train_tfms = tfms.A.Adapter(
          [
              *tfms.A.aug_tfms(presize=presize, size=size),
              tfms.A.Normalize(),
          ]
      )
      valid_tfms = tfms.A.Adapter(
          [*tfms.A.resize_and_pad(size=size), tfms.A.Normalize()]
      )
  
      train_ds = Dataset(train_records, train_tfms)
      valid_ds = Dataset(valid_records, valid_tfms)
  
      model_type = models.mmdet.mask_rcnn
      train_dl = model_type.train_dl(train_ds, batch_size=2)
      valid_dl = model_type.valid_dl(valid_ds, batch_size=2)
  
      backbone = model_type.backbones.resnet50_fpn_1x()
      backbone.config_path = samples_source / backbone.config_path
  
      model = model_type.model(backbone=backbone, num_classes=81)
  
      return train_dl, valid_dl, model, model_type
  
file_path: icevision/tests/models/mmdet/test_model.py
imports: import pytest
  import random
  from icevision.all import *
label_desc: Use image node_id 1 for calling a global function with example usage: mask_dls_model(coco_mask_records, samples_source) and returns: train_dl,  valid_dl,  model,  model_type