code: def get_doublehead_rcnn(
      name,
      dataset,
      pretrained=False,
      ctx=mx.cpu(),
      root=os.path.join("~", ".mxnet", "models"),
      **kwargs,
  ):
      r"""Utility function to return faster rcnn networks.
  
      Parameters
      ----------
      name : str
          Model name.
      dataset : str
          The name of dataset.
      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.
      ctx : mxnet.Context
          Context such as mx.cpu(), mx.gpu(0).
      root : str
          Model weights storing path.
  
      Returns
      -------
      mxnet.gluon.HybridBlock
          The DoubleHeadRCNN-RCNN network.
  
      """
      net = DoubleHeadRCNN(minimal_opset=pretrained, **kwargs)
      if pretrained:
          from ....model_zoo.model_store import get_model_file
  
          full_name = "_".join(("faster_rcnn", name, dataset))
          net.load_parameters(
              get_model_file(full_name, tag=pretrained, root=root),
              ctx=ctx,
              ignore_extra=True,
              allow_missing=True,
          )
          net.collect_params(
              select="normalizedperclassboxcenterencoder*"
          ).initialize()
      else:
          for v in net.collect_params().values():
              try:
                  v.reset_ctx(ctx)
              except ValueError:
                  pass
      return net
  
imports: from __future__ import absolute_import
  import os
  import mxnet
  from mxnet import autograd
  from mxnet.gluon import nn
  from mxnet.gluon.contrib.nn import SyncBatchNorm
  from mxnet.gluon.nn import BatchNorm
  from mxnet.gluon.block import HybridBlock
  from .rcnn_target import RCNNTargetSampler, RCNNTargetGenerator
  from ..rcnn import custom_rcnn_fpn
  from ....model_zoo.rcnn import RCNN
  from ....model_zoo.rcnn.rpn import RPN
label_desc: Use image node_id 2 for calling a global function with example usage: get_doublehead_rcnn(name, dataset, pretrained, ctx, root) and returns: net