DAPPER (Document Analysis, Processing, and Pattern Extraction Repository)
Statistical Learning Final Project for Document Classification
 
Loading...
Searching...
No Matches
layout.LayoutLMv3Dataset Class Reference
Inheritance diagram for layout.LayoutLMv3Dataset:
Inheritance graph
Collaboration diagram for layout.LayoutLMv3Dataset:
Collaboration graph

Public Member Functions

 __init__ (self, dataframe, bucket_name, processor, **kwargs)
 Constructor for MinioImageDataset class.
 
 get_image_path (self, idx)
 
 __getitem__ (self, idx)
 Fetches and processes a single item from the dataset.
 
- Public Member Functions inherited from classification.data.minio_dataset.MinioImageDataset
 __len__ (self)
 Returns the number of items in the dataset.
 

Public Attributes

 processor
 
 apply_ocr
 
 labels
 
 ocr_cache
 
 dataframe
 
- Public Attributes inherited from classification.data.minio_dataset.MinioImageDataset
 df
 
 bucket_name
 
 transform
 
 client
 
 label_map
 

Constructor & Destructor Documentation

◆ __init__()

layout.LayoutLMv3Dataset.__init__ (   self,
  dataframe,
  bucket_name,
  transform,
**  label_map 
)

Constructor for MinioImageDataset class.

Parameters
dataframeDataFrame containing 'image' URLs and 'label' columns
bucket_nameName of the MinIO bucket to fetch images from
transformOptional transformations to apply to the images
label_mapOptional 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 from classification.data.minio_dataset.MinioImageDataset.

Member Function Documentation

◆ __getitem__()

layout.LayoutLMv3Dataset.__getitem__ (   self,
  idx 
)

Fetches and processes a single item from the dataset.

Parameters
idxIndex of the item to fetch
Returns
Tuple of (transformed image tensor, class label tensor)
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 from classification.data.minio_dataset.MinioImageDataset.

◆ get_image_path()

layout.LayoutLMv3Dataset.get_image_path (   self,
  idx 
)
Get the image path for the given index from the dataframe.

Member Data Documentation

◆ apply_ocr

layout.LayoutLMv3Dataset.apply_ocr

◆ dataframe

layout.LayoutLMv3Dataset.dataframe

◆ labels

layout.LayoutLMv3Dataset.labels

◆ ocr_cache

layout.LayoutLMv3Dataset.ocr_cache

◆ processor

layout.LayoutLMv3Dataset.processor

The documentation for this class was generated from the following file: