Skip to content

Commit b5e37a9

Browse files
committed
Add text_direction to inference config
1 parent ffb171e commit b5e37a9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kraken/configs/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def __init__(self, **kwargs):
171171

172172
class RecognitionInferenceConfig(Config):
173173
"""
174-
Configuration for segmentation inference.
174+
Configuration for recognition inference.
175175
176176
Arg:
177177
> Universal parameters
@@ -191,6 +191,8 @@ class RecognitionInferenceConfig(Config):
191191
Number of worker processes to extract lines from images.
192192
no_legacy_polygons (bool, defaults to False):
193193
disables the fast path for polygonal line extraction
194+
text_direction (Literal['horizontal-tb', 'vertical-lr', 'vertical-rl'], defaults to 'horizontal-tb'):
195+
Sets the orientation of bounding box segmentation data
194196
195197
> CTC model parameters
196198
@@ -211,6 +213,7 @@ def __init__(self, **kwargs):
211213
self.no_legacy_polygons = kwargs.pop('no_legacy_polygons', False)
212214
self.decoder = kwargs.pop('decoder', kraken.lib.ctc_decoder.greedy_decoder)
213215
self.bidi_reordering = kwargs.pop('bidi_reordering', True)
216+
self.text_direction = kwargs.pop('text_direction', 'horizontal-tb')
214217
super().__init__(**kwargs)
215218

216219

0 commit comments

Comments
 (0)