From 1ebb6bb3ea706b2ef3c35f336a0c51a35dc8e95b Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 10 Dec 2023 18:14:35 +0100 Subject: [PATCH] Move import statement for KrakenProgressBar from function segtrain to segtest KrakenProgressBar is not used in segtrain, but segtest uses it. Moving the import statement fixes one of several errors reported by flake8. Signed-off-by: Stefan Weil --- kraken/ketos/segmentation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kraken/ketos/segmentation.py b/kraken/ketos/segmentation.py index 711aab1da..0cc8ce41f 100644 --- a/kraken/ketos/segmentation.py +++ b/kraken/ketos/segmentation.py @@ -232,7 +232,6 @@ def segtrain(ctx, output, spec, line_width, pad, load, freq, quit, epochs, from threadpoolctl import threadpool_limits from kraken.lib.train import SegmentationModel, KrakenTrainer - from kraken.lib.progress import KrakenProgressBar if resize != 'fail' and not load: raise click.BadOptionUsage('resize', 'resize option requires loading an existing model') @@ -431,6 +430,7 @@ def segtest(ctx, model, evaluation_files, device, workers, threads, threshold, import torch import torch.nn.functional as F + from kraken.lib.progress import KrakenProgressBar from kraken.lib.train import BaselineSet, ImageInputTransforms from kraken.lib.vgsl import TorchVGSLModel