From 29314c6448721bac474dc06a97f5092114ed9336 Mon Sep 17 00:00:00 2001 From: Benjamin Kiessling Date: Mon, 30 Sep 2024 18:18:08 +0200 Subject: [PATCH] cast vectorizer output to tensor --- kraken/lib/train/segmentation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kraken/lib/train/segmentation.py b/kraken/lib/train/segmentation.py index 8b0486e7a..5ef8cd769 100644 --- a/kraken/lib/train/segmentation.py +++ b/kraken/lib/train/segmentation.py @@ -272,7 +272,7 @@ def validation_step(self, batch, batch_idx): # vectorize and match lines for line_cls, line_idx in self.nn.user_metadata['class_mapping']['baselines'].items(): - pred_bl = vectorize_lines(pred[0, [st_sep, end_sep, line_idx], ...].numpy(), text_direction='horizontal') + pred_bl = [torch.tensor(x) for x in vectorize_lines(pred[0, [st_sep, end_sep, line_idx], ...].numpy(), text_direction='horizontal')] pred_curves = [to_curve(bl, pred.shape[2:][::-1]) for bl in pred_bl] if line_cls in y_curves: target_curves = y_curves[line_cls][0]