From f7efc51cd3fbcee6dedec806b396a9298028da3c Mon Sep 17 00:00:00 2001 From: manonBlanco <blanco@teklia.com> Date: Fri, 22 Dec 2023 15:14:28 +0100 Subject: [PATCH] Nits --- dan/ocr/evaluate.py | 8 ++++---- dan/ocr/manager/metrics.py | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dan/ocr/evaluate.py b/dan/ocr/evaluate.py index 041d309e..c5e79fce 100644 --- a/dan/ocr/evaluate.py +++ b/dan/ocr/evaluate.py @@ -27,16 +27,16 @@ logger = logging.getLogger(__name__) NERVAL_THRESHOLD = 0.30 -def parse_threshold(arg): +def parse_threshold(value): try: - f = float(arg) + value = float(value) except ValueError: raise ArgumentTypeError("Must be a floating point number.") - if f < 0 or f > 1: + if value < 0 or value > 1: raise ArgumentTypeError("Must be between 0 and 1.") - return f + return value def add_evaluate_parser(subcommands) -> None: diff --git a/dan/ocr/manager/metrics.py b/dan/ocr/manager/metrics.py index d7b3f6f2..4e668a68 100644 --- a/dan/ocr/manager/metrics.py +++ b/dan/ocr/manager/metrics.py @@ -162,7 +162,6 @@ class MetricManager: metrics["time"] = [values["time"]] gt, prediction = values["str_y"], values["str_x"] - for metric_name in metric_names: match metric_name: case ( -- GitLab