megatron.data.image_folder#

Description

Classes

DatasetFolder(*args, **kwargs)

A generic data loader where the samples are arranged in this way: .

ImageFolder(*args, **kwargs)

A generic data loader where the images are arranged in this way: .

Functions

accimage_loader(path)

default_loader(path)

has_file_allowed_extension(filename, extensions)

Checks if a file is an allowed extension.

is_image_file(filename)

Checks if a file is an allowed image extension.

make_dataset(directory, class_to_idx, ...[, ...])

Generates a list of samples of a form (path_to_sample, class). :param directory: root dataset directory :type directory: str :param class_to_idx: dictionary mapping class name to class index :type class_to_idx: Dict[str, int] :param extensions: A list of allowed extensions. Either extensions or is_valid_file should be passed. Defaults to None. :type extensions: optional :param is_valid_file: A function that takes path of a file and checks if the file is a valid file (used to check of corrupt files) both extensions and is_valid_file should not be passed. Defaults to None. :type is_valid_file: optional.

pil_loader(path)