From e4b02515479860af708359a9194e123cb9b40203 Mon Sep 17 00:00:00 2001 From: Benjamin Kiessling Date: Fri, 1 Mar 2024 20:06:08 +0100 Subject: [PATCH] Slight template improvements * fix regression in line type attribution * retain region/line identifiers from records --- kraken/serialization.py | 2 +- kraken/templates/alto | 4 ++-- kraken/templates/pagexml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kraken/serialization.py b/kraken/serialization.py index fb2b8ef69..cb335a71b 100644 --- a/kraken/serialization.py +++ b/kraken/serialization.py @@ -163,7 +163,7 @@ def serialize(results: 'Segmentation', # set field to indicate the availability of baseline segmentation in # addition to bounding boxes - line = {'index': idx, + line = {'id': record.id, 'bbox': max_bbox([record.boundary]) if record.type == 'baselines' else record.bbox, 'cuts': record.cuts, 'confidences': record.confidences, diff --git a/kraken/templates/alto b/kraken/templates/alto index f018d2f5b..b3ab3fc4b 100644 --- a/kraken/templates/alto +++ b/kraken/templates/alto @@ -3,7 +3,7 @@ 'postprocessing': 'postOperation'} %} {%+ macro render_line(page, line) +%} - + {% if line.boundary %} @@ -107,7 +107,7 @@ {% if loop.previtem and loop.previtem.type == 'line' %} {% endif %} - + diff --git a/kraken/templates/pagexml b/kraken/templates/pagexml index 6274eaf64..daea1ac00 100644 --- a/kraken/templates/pagexml +++ b/kraken/templates/pagexml @@ -1,5 +1,5 @@ {%+ macro render_line(line) +%} - + {% if line.boundary %} {% endif %} @@ -38,7 +38,7 @@ {% if loop.previtem and loop.previtem.type == 'line' %} {% endif %} - + {%- for line in entity.lines -%} {{ render_line(line) }}