diff --git a/kraken/serialization.py b/kraken/serialization.py index e374eeafb..9666e344c 100644 --- a/kraken/serialization.py +++ b/kraken/serialization.py @@ -152,8 +152,8 @@ def serialize(results: 'Segmentation', reg = reg_dict[record.regions[0]] regs_with_lines.add(reg.id) region = {'id': reg.id, - 'bbox': max_bbox([reg.boundary]), - 'boundary': [list(x) for x in reg.boundary], + 'bbox': max_bbox([reg.boundary]) if reg.boundary else [], + 'boundary': [list(x) for x in reg.boundary] if reg.boundary else [], 'tags': reg.tags, 'lines': [], 'type': 'region' diff --git a/kraken/templates/alto b/kraken/templates/alto index ceed78733..9b8f45efb 100644 --- a/kraken/templates/alto +++ b/kraken/templates/alto @@ -107,7 +107,7 @@ {% if loop.previtem and loop.previtem.type == 'line' %} {% endif %} - + diff --git a/kraken/templates/pagexml b/kraken/templates/pagexml index daea1ac00..596503065 100644 --- a/kraken/templates/pagexml +++ b/kraken/templates/pagexml @@ -39,7 +39,7 @@ {% endif %} - + {% if entity.boundary %}{% endif %} {%- for line in entity.lines -%} {{ render_line(line) }} {%- endfor %}