class_docstr: Image data loader with a large number of augmentation choices.
  This loader supports reading from both .rec files and raw image files.
  
  To load input images from .rec files, use `path_imgrec` parameter and to load from raw image
  files, use `path_imglist` and `path_root` parameters.
  
  To use data partition (for distributed training) or shuffling, specify `path_imgidx` parameter.
  
  Parameters
  ----------
  batch_size : int
      Number of examples per batch.
  data_shape : tuple
      Data shape in (channels, height, width) format.
      For now, only RGB image with 3 channels is supported.
  path_imgrec : str
      Path to image record file (.rec).
      Created with tools/im2rec.py or bin/im2rec.
  path_imglist : str
      Path to image list (.lst).
      Created with tools/im2rec.py or with custom script.
      Format: Tab separated record of index, one or more labels and relative_path_from_root.
  imglist: list
      A list of images with the label(s).
      Each item is a list [imagelabel: float or list of float, imgpath].
  path_root : str
      Root folder of image files.
      Whether to shuffle all images at the start of each iteration or not.
      Can be slow for HDD.
  part_index : int
      Partition index.
  num_parts : int
      Total number of partitions.
  dtype : str
      Label data type. Default: float32. Other options: int32, int64, float64
  last_batch : {'keep', 'discard', 'rollover'}
      How to handle the last batch if batch_size does not evenly divide
      `len(dataset)`.
  
      keep - A batch with less samples than previous batches is returned.
      discard - The last batch is discarded if its incomplete.
      rollover - The remaining samples are rolled over to the next epoch.
  kwargs : ...
      More arguments for creating augmenter. See mx.gluon.contrib.vision.dataloader.create_image_augment.
code: def __init__(
      self,
      batch_size,
      data_shape,
      path_imgrec=None,
      path_imglist=None,
      path_root=".",
      part_index=0,
      num_parts=1,
      aug_list=None,
      imglist=None,
      dtype="float32",
      shuffle=False,
      sampler=None,
      last_batch=None,
      batch_sampler=None,
      batchify_fn=None,
      num_workers=0,
      pin_memory=False,
      pin_device_id=0,
      prefetch=None,
      thread_pool=False,
      timeout=120,
      try_nopython=None,
      **kwargs,
  ):
      assert path_imgrec or path_imglist or (isinstance(imglist, list))
      assert dtype in ["int32", "float32", "int64", "float64"], (
          dtype + " label not supported"
      )
      logging.info("Using %s workers for decoding...", str(num_workers))
      logging.info(
          "Set `num_workers` variable to a larger number to speed up loading"
          " (it requires shared memory to work and may occupy more memory)."
      )
      class_name = self.__class__.__name__
      if path_imgrec:
          logging.info(
              "%s: loading recordio %s...", class_name, path_imgrec
          )
          from ....data.vision.datasets import ImageRecordDataset
  
          dataset = ImageRecordDataset(path_imgrec, flag=1)
      elif path_imglist:
          logging.info(
              "%s: loading image list %s...", class_name, path_imglist
          )
          from ....data.vision.datasets import ImageListDataset
  
          dataset = ImageListDataset(path_root, path_imglist, flag=1)
      elif isinstance(imglist, list):
          logging.info("%s: loading image list...", class_name)
          from ....data.vision.datasets import ImageListDataset
  
          dataset = ImageListDataset(path_root, imglist, flag=1)
      else:
          raise ValueError(
              "Either path_imgrec, path_imglist, or imglist must be provided"
          )
  
      if num_parts > 1:
          dataset = dataset.shard(num_parts, part_index)
  
      if aug_list is None:
          # apply default transforms
          augmenter = create_image_augment(data_shape, **kwargs)
      elif isinstance(aug_list, list):
          if all([isinstance(a, HybridBlock) for a in aug_list]):
              augmenter = HybridSequential()
          else:
              augmenter = Sequential()
          for aug in aug_list:
              augmenter.add(aug)
      elif isinstance(aug_list, Block):
          augmenter = aug_list
      else:
          raise ValueError("aug_list must be a list of Blocks or Block")
      augmenter.hybridize()
      self._iter = DataLoader(
          dataset.transform_first(augmenter),
          batch_size=batch_size,
          shuffle=shuffle,
          sampler=sampler,
          last_batch=last_batch,
          batch_sampler=batch_sampler,
          batchify_fn=batchify_fn,
          num_workers=num_workers,
          pin_memory=pin_memory,
          pin_device_id=pin_device_id,
          prefetch=prefetch,
          thread_pool=thread_pool,
          timeout=timeout,
          try_nopython=try_nopython,
      )
  
imports: import logging
  import numpy
  from .....None import ndarray
  from .....util import is_np_array
  from .....None import numpy
  from ....nn import HybridSequential, Sequential, HybridBlock, Block
  from ....data.vision import transforms
  from ....data import DataLoader
  from .transforms import bbox
label_desc: Use image node_id 1 to create a new ImageDataLoader object from inherited base classes: object with example: obj = ImageDataLoader(batch_size, data_shape, path_imgrec, path_imglist, path_root, part_index, num_parts, aug_list, imglist, dtype, shuffle, sampler, last_batch, batch_sampler, batchify_fn, num_workers, pin_memory, pin_device_id, prefetch, thread_pool, timeout, try_nopython)