Skip to content

Commit

Permalink
cast vectorizer output to tensor
Browse files Browse the repository at this point in the history
  • Loading branch information
mittagessen committed Sep 30, 2024
1 parent 4845ac0 commit 29314c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kraken/lib/train/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 29314c6

Please sign in to comment.