From 3c4de102f6d97a1a01e0169e203c63badce22a1b Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 22 Jan 2023 17:48:31 +0100 Subject: [PATCH] 8.0.15 CLI float bug fix (#567) --- tests/test_cli.py | 2 +- ultralytics/__init__.py | 2 +- ultralytics/yolo/cfg/__init__.py | 10 +++++----- ultralytics/yolo/engine/model.py | 1 - 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index 65dc367..259fd9a 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -48,7 +48,7 @@ def test_val_classify(): # Predict checks ------------------------------------------------------------------------------------------------------- def test_predict_detect(): - run(f"yolo predict detect model={MODEL}.pt source={ROOT / 'assets'}") + run(f"yolo predict detect model={MODEL}.pt source={ROOT / 'assets'} imgsz=320 conf=0.25") def test_predict_segment(): diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index e6d9b95..30bc3ff 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics YOLO 🚀, GPL-3.0 license -__version__ = "8.0.14" +__version__ = "8.0.15" from ultralytics.yolo.engine.model import YOLO from ultralytics.yolo.utils import ops diff --git a/ultralytics/yolo/cfg/__init__.py b/ultralytics/yolo/cfg/__init__.py index 092406b..f0f8f84 100644 --- a/ultralytics/yolo/cfg/__init__.py +++ b/ultralytics/yolo/cfg/__init__.py @@ -1,4 +1,5 @@ # Ultralytics YOLO 🚀, GPL-3.0 license +import contextlib import re import shutil import sys @@ -154,16 +155,15 @@ def entrypoint(debug=False): LOGGER.info(f"{PREFIX}Overriding {DEFAULT_CFG_PATH} with {v}") overrides = {k: val for k, val in yaml_load(v).items() if k != 'cfg'} else: - if v.isnumeric(): - v = eval(v) - elif v.lower() == 'none': + if v.lower() == 'none': v = None elif v.lower() == 'true': v = True elif v.lower() == 'false': v = False - elif ',' in v: - v = eval(v) + else: + with contextlib.suppress(Exception): + v = eval(v) overrides[k] = v except (NameError, SyntaxError, ValueError) as e: raise argument_error(a) from e diff --git a/ultralytics/yolo/engine/model.py b/ultralytics/yolo/engine/model.py index bb5193f..b0ebfd4 100644 --- a/ultralytics/yolo/engine/model.py +++ b/ultralytics/yolo/engine/model.py @@ -172,7 +172,6 @@ class YOLO: args = get_cfg(cfg=DEFAULT_CFG, overrides=overrides) args.task = self.task - print(args) exporter = Exporter(overrides=args) exporter(model=self.model)