public abstract class ImageClassificationDataset extends ImageDataset
Datasets for Application.CV.IMAGE_CLASSIFICATION.ImageDataset.BaseBuilder<T extends ImageDataset.BaseBuilder<T>>flag| Constructor and Description |
|---|
ImageClassificationDataset(ImageDataset.BaseBuilder<?> builder)
Creates a new instance of
RandomAccessDataset with the given necessary
configurations. |
| Modifier and Type | Method and Description |
|---|---|
ai.djl.training.dataset.Record |
get(ai.djl.ndarray.NDManager manager,
long index) |
abstract java.util.List<java.lang.String> |
getClasses()
Returns the classes that the images in the dataset are classified into.
|
protected abstract long |
getClassNumber(long index)
Returns the class of the data item at the given index.
|
ai.djl.translate.Translator<ai.djl.modality.cv.Image,ai.djl.modality.Classifications> |
makeTranslator()
Returns the
ImageClassificationTranslator matching the format of this dataset. |
getImage, getImageChannels, getImageHeight, getImageWidth, getRecordImageavailableSize, getData, getData, getData, getData, randomSplit, size, subDataset, toArraypublic ImageClassificationDataset(ImageDataset.BaseBuilder<?> builder)
RandomAccessDataset with the given necessary
configurations.builder - a builder with the necessary configurationsprotected abstract long getClassNumber(long index)
throws java.io.IOException
index - the index (if the dataset is a list of data items)java.io.IOException - if the data could not be loadedpublic ai.djl.training.dataset.Record get(ai.djl.ndarray.NDManager manager,
long index)
throws java.io.IOException
get in class ai.djl.training.dataset.RandomAccessDatasetjava.io.IOExceptionpublic ai.djl.translate.Translator<ai.djl.modality.cv.Image,ai.djl.modality.Classifications> makeTranslator()
ImageClassificationTranslator matching the format of this dataset.ImageClassificationTranslator matching the format of this datasetpublic abstract java.util.List<java.lang.String> getClasses()