Skip to content

clsdataloader

clsdataloader

Module for ClsDataLoader

Classes

ClsDataLoader

ClsDataLoader()

Bases: DataLoader

DataLoader for image classification data

Source code in niceml/data/dataloaders/dataloader.py
def __init__(self):
    self.data_description = None
Functions
load_data
load_data(data_info)

Loads and returns image classification data from 'data_info'

Source code in niceml/data/dataloaders/clsdataloader.py
def load_data(self, data_info: ClsDataInfo) -> ClsData:
    """Loads and returns image classification data from 'data_info'"""
    input_data_description: InputImageDataDescription = check_instance(
        self.data_description, InputImageDataDescription
    )
    image = load_img_uint8(
        data_info.image_location,
        target_image_size=input_data_description.get_input_image_size(),
    )
    return ClsData(
        identifier=data_info.get_identifier(),
        image=image,
        class_name=data_info.get_name_list(),
        class_idx=data_info.get_index_list(),
    )

Functions