Class ImageClassificationDataset
java.lang.Object
ai.djl.training.dataset.RandomAccessDataset
ai.djl.basicdataset.cv.ImageDataset
ai.djl.basicdataset.cv.classification.ImageClassificationDataset
- All Implemented Interfaces:
ai.djl.training.dataset.Dataset
- Direct Known Subclasses:
AbstractImageFolder
A helper to create
Datasets for Application.CV.IMAGE_CLASSIFICATION.-
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
ConstructorsConstructorDescriptionImageClassificationDataset(ImageDataset.BaseBuilder<?> builder) Creates a new instance ofRandomAccessDatasetwith the given necessary configurations. -
Method Summary
Modifier and TypeMethodDescriptionai.djl.training.dataset.Recordget(ai.djl.ndarray.NDManager manager, long index) Returns the classes that the images in the dataset are classified into.protected abstract longgetClassNumber(long index) Returns the class of the data item at the given index.ai.djl.translate.TranslatorOptionsMethods 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
prepare, prepare
-
Constructor Details
-
ImageClassificationDataset
Creates a new instance ofRandomAccessDatasetwith the given necessary configurations.- Parameters:
builder- a builder with the necessary configurations
-
-
Method Details
-
getClassNumber
Returns the class of the data item at the given index.- Parameters:
index- the index (if the dataset is a list of data items)- Returns:
- the class number or the index into the list of classes of the desired class name
- Throws:
IOException- if the data could not be loaded
-
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
-
matchingTranslatorOptions
public ai.djl.translate.TranslatorOptions matchingTranslatorOptions() -
getClasses
Returns the classes that the images in the dataset are classified into.- Returns:
- the classes that the images in the dataset are classified into
-