From d53b4faf2f3ab8e3baf68e60a5cd8add04ab25fd Mon Sep 17 00:00:00 2001 From: Benjamin Kiessling Date: Fri, 27 Sep 2024 21:40:45 +0200 Subject: [PATCH] fix transcription tests --- tests/test_transcribe.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/test_transcribe.py b/tests/test_transcribe.py index 044779813..724dc04cc 100644 --- a/tests/test_transcribe.py +++ b/tests/test_transcribe.py @@ -8,6 +8,7 @@ from lxml import etree from PIL import Image +from kraken.containers import Segmentation, BBoxLine from kraken.transcribe import TranscriptionInterface thisfile = Path(__file__).resolve().parent @@ -24,8 +25,16 @@ def test_transcription_generation(self): Tests creation of transcription interfaces with segmentation. """ tr = TranscriptionInterface() - with open(resources / 'segmentation.json') as fp: - seg = json.load(fp) + + + seg = Segmentation(type='bbox', + imagename = resources / 'bw.png', + lines=[BBoxLine(id='foo', + bbox=[200, 10, 400, 156])], + text_direction='horizontal-lr', + script_detection=False + ) + with Image.open(resources / 'input.jpg') as im: tr.add_page(im, seg) fp = BytesIO()