mirror of
https://github.com/mikegerber/ocrd_calamari.git
synced 2025-06-09 19:59:53 +02:00
remove existing annotation below the line level to avoid inconsistency
This commit is contained in:
parent
2f87ae662d
commit
103b1d7671
1 changed files with 6 additions and 0 deletions
|
@ -77,7 +77,13 @@ class CalamariRecognize(Processor):
|
||||||
line_text = prediction.sentence
|
line_text = prediction.sentence
|
||||||
line_conf = prediction.avg_char_probability
|
line_conf = prediction.avg_char_probability
|
||||||
|
|
||||||
|
if line.get_TextEquiv():
|
||||||
|
log.warning("Line '%s' already contained text results", line.id)
|
||||||
line.set_TextEquiv([TextEquivType(Unicode=line_text, conf=line_conf)])
|
line.set_TextEquiv([TextEquivType(Unicode=line_text, conf=line_conf)])
|
||||||
|
|
||||||
|
if line.get_Word():
|
||||||
|
log.warning("Line '%s' already contained word segmentation", line.id)
|
||||||
|
line.set_Word([])
|
||||||
|
|
||||||
_page_update_higher_textequiv_levels('line', pcgts)
|
_page_update_higher_textequiv_levels('line', pcgts)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue