flow_segmenter.segmenter.SegmenterKrakenLinemasks

class flow_segmenter.segmenter.SegmenterKrakenLinemasks(config)[source]

Kraken Linemask Segmenter. Use kraken’s default blla model to predict baselines and line masks for existing text lines in the XML.

Parameters:

config (SegmenterBaseConfig) – SegmenterBaseConfig instance with options for baselines and linemasks.

__init__(config)[source]
Parameters:

config (SegmenterBaseConfig)

Return type:

None

Methods

__init__(config)

get_batchsize(batch_sizes)

Method to get the batch size of the model :param batch_sizes: List of batch sizes or a single batch size int :return: Batch size of the model

segment(image[, xml_etree])

Segment an image by adding baselines and linemasks using kraken's default blla model.

segment_dataset(dataset[, new_column_name])

Segment a HuggingFace dataset with the loaded model.