Manager class for MinIO object storage operations. More...

Public Member Functions | |
| __init__ (self, endpoint="localhost:9900", access_key="minioadmin", secret_key="minioadmin", bucket_name="dapper", bool secure=False) | |
| Constructor for MinioManager class. | |
| str | upload_image (self, Image.Image image, str filename) |
| Uploads an image to MinIO storage. | |
| Optional[tuple] | process_row (self, int index, pd.Series row) |
| Processes a single row from a DataFrame for upload. | |
| pd.DataFrame | upload_dataframe (self, pd.DataFrame df, int max_workers=12) |
| Uploads all images from a DataFrame to MinIO. | |
Public Attributes | |
| client | |
| endpoint | |
| bucket_name | |
| all_images | |
Protected Member Functions | |
| _refresh_object_list (self) | |
| Refreshes the list of objects in the bucket. | |
| str | _generate_filename (self, str label, int index, str source, bool is_augmented) |
| Generates a standardized filename for image storage. | |
Manager class for MinIO object storage operations.
This class provides methods for interacting with MinIO object storage, including uploading images, managing buckets, and organizing data with consistent naming conventions for document classification tasks.
| classification.data.minio_handler.MinioManager.__init__ | ( | self, | |
endpoint = "localhost:9900", |
|||
access_key = "minioadmin", |
|||
secret_key = "minioadmin", |
|||
bucket_name = "dapper", |
|||
| bool | secure = False |
||
| ) |
Constructor for MinioManager class.
| endpoint | MinIO server endpoint URL |
| access_key | MinIO access key |
| secret_key | MinIO secret key |
| bucket_name | Name of the MinIO bucket to use |
| secure | Use TLS for MinIO connection |
|
protected |
Generates a standardized filename for image storage.
| label | Class label for the image |
| index | Index of the image in the dataset |
| source | Source dataset name |
| is_augmented | Whether the image is an augmented version |
|
protected |
Refreshes the list of objects in the bucket.
Updates the internal cache of object names in the MinIO bucket to track which images have already been uploaded.
| Optional[tuple] classification.data.minio_handler.MinioManager.process_row | ( | self, | |
| int | index, | ||
| pd.Series | row | ||
| ) |
Processes a single row from a DataFrame for upload.
| index | Index of the row in the DataFrame |
| row | Series containing image and metadata |
| pd.DataFrame classification.data.minio_handler.MinioManager.upload_dataframe | ( | self, | |
| pd.DataFrame | df, | ||
| int | max_workers = 12 |
||
| ) |
Uploads all images from a DataFrame to MinIO.
| df | DataFrame containing images and metadata |
| max_workers | Maximum number of worker threads for parallel processing |
| str classification.data.minio_handler.MinioManager.upload_image | ( | self, | |
| Image.Image | image, | ||
| str | filename | ||
| ) |
Uploads an image to MinIO storage.
| image | PIL Image to upload |
| filename | Name to use for the uploaded file |
| classification.data.minio_handler.MinioManager.all_images |
| classification.data.minio_handler.MinioManager.bucket_name |
| classification.data.minio_handler.MinioManager.client |
| classification.data.minio_handler.MinioManager.endpoint |