sparkocr.transformers.visual_encoder_decoder.Dit#

Module Contents#

Classes#

Dit

DitDatasetIterable

Creates an IterableDataset from a PySpark Dataframe

Functions#

normalize_bbox(bbox, width, height)

class Dit(base_model_path, params)#
base_model_path#
batch_size#
checkpoint_model#
device#
label2id#
model#
params#
patch_size#
smoothing = 0.1#
window_size#
finish_model(checkpoint_model)#
to_onnx(onnx_model_path, validate=False, atol=0.01)#
train(df)#
update_config_labels(labels)#
class DitDatasetIterable(df, image_col='image', labels_col='label', n_width=224, n_height=224, label2id={})#

Bases: torch.utils.data.IterableDataset

Creates an IterableDataset from a PySpark Dataframe It returns images and labels.

dataset#
df#
image_col = 'image'#
label2id#
label_col = 'label'#
n_height = 224#
n_width = 224#
normalize_bbox(bbox, width, height)#