PyTorch Dataset for loading images from MinIO storage. More...


Public Member Functions | |
| __init__ (self, dataframe, bucket_name, transform=None, label_map=None) | |
| Constructor for MinioImageDataset class. | |
| __len__ (self) | |
| Returns the number of items in the dataset. | |
| __getitem__ (self, idx) | |
| Fetches and processes a single item from the dataset. | |
Public Attributes | |
| df | |
| bucket_name | |
| transform | |
| client | |
| label_map | |
PyTorch Dataset for loading images from MinIO storage.
This class extends PyTorch's Dataset class to load images from MinIO object storage. It takes a DataFrame with image URLs, connects to MinIO, fetches images by their names, applies transformations, and returns image-label pairs for model training.
PyTorch Dataset for loading images from MinIO storage
| classification.data.minio_dataset.MinioImageDataset.__init__ | ( | self, | |
| dataframe, | |||
| bucket_name, | |||
transform = None, |
|||
label_map = None |
|||
| ) |
Constructor for MinioImageDataset class.
| dataframe | DataFrame containing 'image' URLs and 'label' columns |
| bucket_name | Name of the MinIO bucket to fetch images from |
| transform | Optional transformations to apply to the images |
| label_map | Optional dictionary mapping label strings to integers |
Constructor for MinioImageDataset class
Args:
dataframe: DataFrame containing 'image' URLs and 'label' columns
bucket_name: Name of the MinIO bucket to fetch images from
transform: Optional transformations to apply to the images
label_map: Optional dictionary mapping label strings to integers
Reimplemented in layout.LayoutLMv3Dataset.
| classification.data.minio_dataset.MinioImageDataset.__getitem__ | ( | self, | |
| idx | |||
| ) |
Fetches and processes a single item from the dataset.
| idx | Index of the item to fetch |
Fetches and processes a single item from the dataset
Args:
idx: Index of the item to fetch
Returns:
Tuple of (transformed image tensor, class label tensor)
Reimplemented in layout.LayoutLMv3Dataset.
| classification.data.minio_dataset.MinioImageDataset.__len__ | ( | self | ) |
Returns the number of items in the dataset.
Returns the number of items in the dataset
Returns:
Number of images in the dataset
| classification.data.minio_dataset.MinioImageDataset.bucket_name |
| classification.data.minio_dataset.MinioImageDataset.client |
| classification.data.minio_dataset.MinioImageDataset.df |
| classification.data.minio_dataset.MinioImageDataset.label_map |
| classification.data.minio_dataset.MinioImageDataset.transform |