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() == "voc_tiny":
          # need to download the dataset and specify the path to store the dataset in
          # root = os.path.expanduser('~/.mxnet/datasets/')
          # filename_zip = ag.download('https://autogluon.s3.amazonaws.com/datasets/tiny_motorbike.zip', path=root)
          # filename = ag.unzip(filename_zip, root=root)
          # data_root = os.path.join(root, filename)
          train_dataset = gdata.CustomVOCDetectionBase(
              classes=("motorbike",),
              root=args.dataset_root + "tiny_motorbike",
              splits=[("", "trainval")],
          )
          val_dataset = gdata.CustomVOCDetectionBase(
              classes=("motorbike",),
              root=args.dataset_root + "tiny_motorbike",
              splits=[("", "test")],
          )
          val_metric = VOC07MApMetric(
              iou_thresh=0.5, class_names=val_dataset.classes
          )
      elif dataset.lower() == "coco":
          train_dataset = gdata.COCODetection(
              splits=["instances_train2017"]
          )
          val_dataset = gdata.COCODetection(
              splits=["instances_val2017"], skip_empty=False
          )
          val_metric = COCODetectionMetric(
              val_dataset,
              os.path.join(args.logdir, args.save_prefix + "_eval"),
              cleanup=True,
              data_shape=(args.ssd.data_shape, args.ssd.data_shape),
          )
          # coco validation is slow, consider increase the validation interval
          if args.validation.val_interval == 1:
              args.validation.val_interval = 10
      else:
          raise NotImplementedError(
              "Dataset: {} not implemented.".format(dataset)
          )
      return train_dataset, val_dataset, val_metric
  
file_path: gluon-cv/gluoncv/auto/estimators/ssd/utils.py
imports: import os
  import mxnet
  from mxnet import gluon
  from mxnet import autograd
  from ....data.batchify import Tuple, Stack, Pad
  from ....data.transforms.presets.ssd import SSDDefaultTrainTransform
  from ....data.transforms.presets.ssd import SSDDefaultValTransform
  from ....data.transforms.presets.ssd import SSDDALIPipeline
  from ....None import data
  from ....utils.metrics.voc_detection import VOC07MApMetric
  from ....utils.metrics.coco_detection import COCODetectionMetric
label_desc: Use image node_id 1 for calling a global function with example usage: _get_dataset(dataset, args) and returns: train_dataset,  val_dataset,  val_metric