code: def mask_rcnn_resnet18_v1b_coco(
      pretrained=False,
      pretrained_base=True,
      rcnn_max_dets=1000,
      rpn_test_pre_nms=6000,
      rpn_test_post_nms=1000,
      **kwargs,
  ):
      r"""Mask RCNN model from the paper
      "He, K., Gkioxari, G., Doll&ar, P., & Girshick, R. (2017). Mask R-CNN"
  
      Parameters
      ----------
      pretrained : bool or str
          Boolean value controls whether to load the default pretrained weights for model.
          String value represents the hashtag for a certain version of pretrained weights.
      pretrained_base : bool or str, optional, default is True
          Load pretrained base network, the extra layers are randomized. Note that
          if pretrained is `True`, this has no effect.
      rcnn_max_dets : int, default is 1000
          Number of rois to retain in RCNN.
      rpn_test_pre_nms : int, default is 6000
          Filter top proposals before NMS in testing of RPN.
      rpn_test_post_nms : int, default is 300
          Return top proposal results after NMS in testing of RPN.
      ctx : Context, default CPU
          The context in which to load the pretrained weights.
      root : str, default '~/.mxnet/models'
          Location for keeping the model parameters.
  
      Examples
      --------
      >>> model = mask_rcnn_resnet18_v1b_coco(pretrained=True)
      >>> print(model)
      """
      from ....model_zoo.resnetv1b import resnet18_v1b
      from ....data import COCODetection
  
      classes = COCODetection.CLASSES
      pretrained_base = False if pretrained else pretrained_base
      rcnn_max_dets = (
          rpn_test_post_nms
          if rcnn_max_dets > rpn_test_post_nms
          else rcnn_max_dets
      )
      base_network = resnet18_v1b(
          pretrained=pretrained_base,
          dilated=False,
          use_global_stats=True,
      )
      features = nn.HybridSequential()
      top_features = nn.HybridSequential()
      for layer in [
          "conv1",
          "bn1",
          "relu",
          "maxpool",
          "layer1",
          "layer2",
          "layer3",
      ]:
          features.add(getattr(base_network, layer))
      for layer in ["layer4"]:
          top_features.add(getattr(base_network, layer))
      train_patterns = "|".join(
          [
              ".*dense",
              ".*rpn",
              ".*mask",
              ".*down(2|3|4)_conv",
              ".*layers(2|3|4)_conv",
          ]
      )
      return get_mask_rcnn(
          name="resnet18_v1b",
          dataset="coco",
          pretrained=pretrained,
          features=features,
          top_features=top_features,
          classes=classes,
          mask_channels=256,
          rcnn_max_dets=rcnn_max_dets,
          short=800,
          max_size=1333,
          train_patterns=train_patterns,
          nms_thresh=0.5,
          nms_topk=-1,
          post_nms=-1,
          roi_mode="align",
          roi_size=(14, 14),
          strides=16,
          clip=4.42,
          rpn_channel=1024,
          base_size=16,
          scales=(2, 4, 8, 16, 32),
          ratios=(0.5, 1, 2),
          alloc_size=(128, 128),
          rpn_nms_thresh=0.7,
          rpn_train_pre_nms=12000,
          rpn_train_post_nms=2000,
          rpn_test_pre_nms=rpn_test_pre_nms,
          rpn_test_post_nms=rpn_test_post_nms,
          rpn_min_size=1,
          num_sample=256,
          pos_iou_thresh=0.5,
          pos_ratio=0.25,
          **kwargs,
      )
  
file_path: gluon-cv/gluoncv/model_zoo/rcnn/mask_rcnn/predefined_models.py
imports: from __future__ import absolute_import
  import mxnet
  from mxnet.gluon import nn
  from mxnet.gluon.contrib.nn import SyncBatchNorm
  from ..mask_rcnn import get_mask_rcnn
  from ....nn.feature import FPNFeatureExpander
label_desc: Use image node_id 5 for calling a global function with example usage: mask_rcnn_resnet18_v1b_coco(pretrained, pretrained_base, rcnn_max_dets, rpn_test_pre_nms, rpn_test_post_nms) and returns: get_mask_rcnn