Class ObjectDetectionDataset

java.lang.Object
ai.djl.training.dataset.RandomAccessDataset
ai.djl.basicdataset.cv.ImageDataset
ai.djl.basicdataset.cv.ObjectDetectionDataset
All Implemented Interfaces:
ai.djl.training.dataset.Dataset
Direct Known Subclasses:
BananaDetection, CocoDetection, PikachuDetection

public abstract class ObjectDetectionDataset extends ImageDataset
A helper to create Datasets for Application.CV.OBJECT_DETECTION.
  • Nested Class Summary

    Nested classes/interfaces inherited from class ai.djl.basicdataset.cv.ImageDataset

    ImageDataset.BaseBuilder<T extends ImageDataset.BaseBuilder<T>>

    Nested classes/interfaces inherited from interface ai.djl.training.dataset.Dataset

    ai.djl.training.dataset.Dataset.Usage
  • Field Summary

    Fields inherited from class ai.djl.basicdataset.cv.ImageDataset

    flag

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

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

    Constructors
    Constructor
    Description
    Creates a new instance of ObjectDetectionDataset with the given necessary configurations.
  • Method Summary

    Modifier and Type
    Method
    Description
    ai.djl.training.dataset.Record
    get(ai.djl.ndarray.NDManager manager, long index)
    abstract List<String>
    Returns the classes that detected objects in the dataset can be classified into.
    abstract ai.djl.util.PairList<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.basicdataset.cv.ImageDataset

    getImage, getImageChannels, getImageHeight, getImageWidth, getRecordImage

    Methods inherited from class ai.djl.training.dataset.RandomAccessDataset

    availableSize, getData, getData, getData, getData, newSubDataset, newSubDataset, randomSplit, size, subDataset, subDataset, subDataset, 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

    matchingTranslatorOptions, prepare, prepare
  • Constructor Details

    • 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 Details

    • get

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

      public abstract ai.djl.util.PairList<Long,ai.djl.modality.cv.output.Rectangle> getObjects(long index) throws 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:
      IOException - if the data could not be loaded
    • getClasses

      public abstract List<String> getClasses()
      Returns the classes that detected objects in the dataset can be classified into.
      Returns:
      the classes that detected objects in the dataset can be classified into.