Skip to content

Commit

Permalink
Actually make multi-model segmentation work
Browse files Browse the repository at this point in the history
  • Loading branch information
mittagessen committed Jul 29, 2024
1 parent 4219c46 commit 38484c3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kraken/kraken.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,6 @@ def segment(ctx, model, boxes, text_direction, scale, maxcolseps,
"""
from kraken.containers import ProcessingStep

print(model)

if model and boxes:
logger.warning(f'Baseline model ({model}) given but legacy segmenter selected. Forcing to -bl.')
boxes = False
Expand Down Expand Up @@ -536,7 +534,8 @@ def segment(ctx, model, boxes, text_direction, scale, maxcolseps,
for loc in locations:
message(f'Loading ANN {loc}\t', nl=False)
try:
models.append(TorchVGSLModel.load_model(loc).to(ctx.meta['device']))
models.append(TorchVGSLModel.load_model(loc))
models[-1].to(ctx.meta['device'])
except Exception:
if ctx.meta['raise_failed']:
raise
Expand Down

0 comments on commit 38484c3

Please sign in to comment.