Loader class for HuggingFace Invoices dataset. More...

Public Member Functions | |
| __init__ (self, MinioManager minio_manager, Augmentor augmentor, int seed=42, bool apply_ocr=False) | |
| Constructor for HFInvoicesLoader class. | |
| pd.DataFrame | load_dataset (self, int chunk_size=100, Optional[int] total_samples=None, bool apply_augmentation=True, int augmentation_factor=3, str split="train") |
| Loads and processes the HuggingFace Invoices dataset. | |
Public Attributes | |
| minio_manager | |
| augmentor | |
| seed | |
| apply_ocr | |
Protected Member Functions | |
| _bytes_to_image (self, image_data) | |
| Converts bytes data to PIL Image. | |
Loader class for HuggingFace Invoices dataset.
This class provides methods for loading and processing invoice images from the HuggingFace datasets repository. It handles data loading, image conversion, augmentation, and integration with MinIO storage for document classification tasks.
| classification.datasets.loader_hf_invoices.HFInvoicesLoader.__init__ | ( | self, | |
| MinioManager | minio_manager, | ||
| Augmentor | augmentor, | ||
| int | seed = 42, |
||
| bool | apply_ocr = False |
||
| ) |
Constructor for HFInvoicesLoader class.
| minio_manager | MinIO manager instance for data storage |
| augmentor | Augmentor instance for data augmentation |
| seed | Random seed for reproducibility |
|
protected |
Converts bytes data to PIL Image.
| image_data | Image data in bytes format |
Convert bytes data to PIL Image
| pd.DataFrame classification.datasets.loader_hf_invoices.HFInvoicesLoader.load_dataset | ( | self, | |
| int | chunk_size = 100, |
||
| Optional[int] | total_samples = None, |
||
| bool | apply_augmentation = True, |
||
| int | augmentation_factor = 3, |
||
| str | split = "train" |
||
| ) |
Loads and processes the HuggingFace Invoices dataset.
| chunk_size | Number of samples to process in each chunk |
| total_samples | Total number of samples to load (None for all) |
| apply_augmentation | Whether to apply data augmentation |
| augmentation_factor | Number of augmented versions to create per image |
| split | Dataset split to load ('train', 'validation', or 'test') |
| classification.datasets.loader_hf_invoices.HFInvoicesLoader.apply_ocr |
| classification.datasets.loader_hf_invoices.HFInvoicesLoader.augmentor |
| classification.datasets.loader_hf_invoices.HFInvoicesLoader.minio_manager |
| classification.datasets.loader_hf_invoices.HFInvoicesLoader.seed |