ImageClassificationDataset<T>

Models & Types · AiDotNet.Data.Vision

An in-memory image classification dataset with an optional composable transform pipeline.

Inheritance: DataLoaderBase<T> → InputOutputDataLoaderBase<T, Tensor<T>, Tensor<T>> → ImageClassificationDataset<T>

For Beginners

If you have images already loaded as arrays/tensors and want to apply normalization or other transforms:

How It Works

Holds image tensors and class labels in memory with optional transforms applied on access. Use this when you already have image data as tensors and want to attach a transform pipeline. For loading from disk, use ImageFolderDataset instead.

Constructors

Constructor Summary
ImageClassificationDataset(T[][] images, int[] labels, int imageHeight, int imageWidth, int channels, ITransform<T[], T[]> transform) Creates an in-memory image classification dataset.
ImageClassificationDataset(Tensor<T>[] imageTensors, int[] labels, ITransform<T[], T[]> transform) Creates an in-memory image classification dataset from tensors.

Properties

Property Summary
int Channels { get; } Gets the number of channels.
int FeatureCount { get; }
int ImageHeight { get; } Gets the image height.
int ImageWidth { get; } Gets the image width.
int NumClasses { get; } Gets the number of classes in the dataset.
int OutputDimension { get; }
int TotalCount { get; }
string Description { get; }
string Name { get; }

Methods

Method Summary
ValueTuple<IInputOutputDataLoader<T, Tensor<T>, Tensor<T>>, IInputOutputDataLoader<T, Tensor<T>, Tensor<T>>, IInputOutputDataLoader<T, Tensor<T>, Tensor<T>>> Split(double trainRatio, double validationRatio, int? seed)