Skip to content

Commit

Permalink
Fix regression in tag selection in rpred.mm_rpred
Browse files Browse the repository at this point in the history
Fixes #564.
  • Loading branch information
mittagessen committed Jan 17, 2024
1 parent baef625 commit aea5098
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kraken/rpred.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ def _recognize_baseline_line(self, line):
return BaselineOCRRecord('', [], [], line)

self.box = box

tag, net = self._resolve_tags_to_model(line.tags, self.nets)
# check if boxes are non-zero in any dimension
if 0 in box.size:
Expand Down Expand Up @@ -340,6 +339,6 @@ def _resolve_tags_to_model(tags: Optional[Sequence[Dict[str, str]]],
for tag in tags.items():
if tag in model_map:
return tag, model_map[tag]
elif tags and default:
return next(tags.values()), default
if tags and default:
return next(iter(tags.items())), default
raise KrakenInputException(f'No model for tags {tags}')

0 comments on commit aea5098

Please sign in to comment.