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
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
flagFields inherited from class ai.djl.training.dataset.RandomAccessDataset
dataBatchifier, device, labelBatchifier, limit, pipeline, prefetchNumber, sampler, targetPipeline -
Constructor Summary
ConstructorsConstructorDescriptionObjectDetectionDataset(ImageDataset.BaseBuilder<?> builder) Creates a new instance ofObjectDetectionDatasetwith the given necessary configurations. -
Method Summary
Modifier and TypeMethodDescriptionai.djl.training.dataset.Recordget(ai.djl.ndarray.NDManager manager, long index) 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, getRecordImageMethods inherited from class ai.djl.training.dataset.RandomAccessDataset
availableSize, getData, getData, getData, getData, newSubDataset, newSubDataset, randomSplit, size, subDataset, subDataset, subDataset, subDataset, toArrayMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ai.djl.training.dataset.Dataset
matchingTranslatorOptions, prepare, prepare
-
Constructor Details
-
ObjectDetectionDataset
Creates a new instance ofObjectDetectionDatasetwith 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:
getin classai.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
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.
-