Package ai.djl.basicdataset.cv
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 createDatasets forApplication.CV.OBJECT_DETECTION.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ai.djl.basicdataset.cv.ImageDataset
ImageDataset.BaseBuilder<T extends ImageDataset.BaseBuilder<T>>
-
-
Field Summary
-
Fields inherited from class ai.djl.basicdataset.cv.ImageDataset
flag
-
-
Constructor Summary
Constructors Constructor Description ObjectDetectionDataset(ImageDataset.BaseBuilder<?> builder)Creates a new instance ofObjectDetectionDatasetwith the given necessary configurations.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ai.djl.training.dataset.Recordget(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.basicdataset.cv.ImageDataset
getImage, getImageChannels, getImageHeight, getImageWidth, getRecordImage
-
Methods inherited from class ai.djl.training.dataset.RandomAccessDataset
availableSize, getData, getData, getData, getData, randomSplit, size, subDataset, toArray
-
-
-
-
Constructor Detail
-
ObjectDetectionDataset
public ObjectDetectionDataset(ImageDataset.BaseBuilder<?> builder)
Creates a new instance ofObjectDetectionDatasetwith 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:
getin classai.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.IOExceptionReturns 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
-
-