Class ObjectDetectionDataset

    • Field Summary

      • Fields inherited from class ai.djl.training.dataset.RandomAccessDataset

        dataBatchifier, device, labelBatchifier, limit, pipeline, prefetchNumber, sampler, targetPipeline
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      ai.djl.training.dataset.Record get​(ai.djl.ndarray.NDManager manager, long index)
      abstract ai.djl.util.PairList<java.lang.Long,​ai.djl.modality.cv.output.Rectangle> getObjects​(long index)
      Returns the list of objects in the image at the given index.
      • Methods inherited from class ai.djl.training.dataset.RandomAccessDataset

        availableSize, getData, getData, getData, getData, randomSplit, size, subDataset, toArray
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface ai.djl.training.dataset.Dataset

        prepare, prepare
    • Constructor Detail

      • ObjectDetectionDataset

        public ObjectDetectionDataset​(ImageDataset.BaseBuilder<?> builder)
        Creates a new instance of ObjectDetectionDataset with the given necessary configurations.
        Parameters:
        builder - a builder with the necessary configurations
    • Method Detail

      • get

        public ai.djl.training.dataset.Record get​(ai.djl.ndarray.NDManager manager,
                                                  long index)
                                           throws java.io.IOException
        Specified by:
        get in class ai.djl.training.dataset.RandomAccessDataset
        Throws:
        java.io.IOException
      • getObjects

        public abstract ai.djl.util.PairList<java.lang.Long,​ai.djl.modality.cv.output.Rectangle> getObjects​(long index)
                                                                                                           throws java.io.IOException
        Returns the list of objects in the image at the given index.
        Parameters:
        index - the index (if the dataset is a list of data items)
        Returns:
        the list of objects in the image. The long is the class number of the index into the list of classes of the desired class name. The rectangle is the location of the object inside the image.
        Throws:
        java.io.IOException - if the data could not be loaded