code: def get_dataset(dataset, args):
      if dataset.lower() == "voc":
          train_dataset = gdata.VOCDetection(
              splits=[(2007, "trainval"), (2012, "trainval")]
          )
          val_dataset = gdata.VOCDetection(splits=[(2007, "test")])
          val_metric = VOC07MApMetric(
              iou_thresh=0.5, class_names=val_dataset.classes
          )
      elif dataset.lower() == "coco":
          train_dataset = gdata.COCODetection(
              splits="instances_train2017", use_crowd=False
          )
          val_dataset = gdata.COCODetection(
              splits="instances_val2017", skip_empty=False
          )
          val_metric = COCODetectionMetric(
              val_dataset, args.save_prefix + "_eval", cleanup=True
          )
      elif dataset.lower() == "visualgenome":
          train_dataset = VGObject(
              root=os.path.join(
                  "~", ".mxnet", "datasets", "visualgenome"
              ),
              splits="detections_train",
              use_crowd=False,
          )
          val_dataset = VGObject(
              root=os.path.join(
                  "~", ".mxnet", "datasets", "visualgenome"
              ),
              splits="detections_val",
              skip_empty=False,
          )
          val_metric = COCODetectionMetric(
              val_dataset, args.save_prefix + "_eval", cleanup=True
          )
      else:
          raise NotImplementedError(
              "Dataset: {} not implemented.".format(dataset)
          )
      if args.mixup:
          from gluoncv.data.mixup import detection
  
          train_dataset = detection.MixupDetection(train_dataset)
      return train_dataset, val_dataset, val_metric
  
imports: import argparse
  import os
  import logging
  import time
  import gluoncv
  import mxnet
  import numpy
  from data import *
  from gluoncv import data, utils
  from gluoncv.data.batchify import Append, FasterRCNNTrainBatchify, Tuple
  from gluoncv.data.transforms.presets.rcnn import FasterRCNNDefaultTrainTransform, FasterRCNNDefaultValTransform
  from gluoncv.model_zoo import get_model
  from gluoncv.utils.metrics.coco_detection import COCODetectionMetric
  from gluoncv.utils.metrics.rcnn import RCNNAccMetric, RCNNL1LossMetric, RPNAccMetric, RPNL1LossMetric
  from gluoncv.utils.metrics.voc_detection import VOC07MApMetric
  from gluoncv.utils.parallel import Parallel, Parallelizable
  from model import faster_rcnn_resnet101_v1d_custom, faster_rcnn_resnet50_v1b_custom
  from mxnet import autograd, gluon
  from mxnet.contrib import amp
label_desc: Use image node_id 2 for calling a global function with example usage: get_dataset(dataset, args) and returns: train_dataset,  val_dataset,  val_metric