Skip to content

Commit

Permalink
fix transcription tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mittagessen committed Sep 27, 2024
1 parent 05fd70e commit d53b4fa
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/test_transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit d53b4fa

Please sign in to comment.