Function tch::vision::imagenet::load_from_dir

source ·
pub fn load_from_dir<T: AsRef<Path>>(dir: T) -> Result<Dataset, TchError>
Expand description

Loads a dataset from a directory.

This assumes that the directory contains two subdirectories named train and val. In each of these datasets, there should be a subdirectory per class named in the same way. The ImageNet normalization is applied, image are resized to 224x224.