ImageFolderDataset<T>

Models & Types · AiDotNet.Data.Vision

Loads images from a directory structure where each subdirectory is a class label.

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

For Beginners

Organize your images into folders named after the classes, and this loader handles the rest:

How It Works

Mirrors PyTorch’s torchvision.datasets.ImageFolder. Expects a directory structure:

Constructors

Constructor Summary
ImageFolderDataset(ImageFolderDatasetOptions options) Creates a new ImageFolderDataset with the specified options.

Properties

Property Summary
IReadOnlyList<string> ClassNames { get; } Gets the class names discovered from directory names.
int FeatureCount { get; }
int NumClasses { get; } Gets the number of classes.
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)