ultralytics 8.0.62 HUB Syntax updates and fixes (#1795)

Co-authored-by: Danny Kim <imbird0312@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: MagicCodess <32194768+MagicCodess@users.noreply.github.com>
Co-authored-by: ayush chaurasia <ayush.chaurarsia@gmail.com>
Co-authored-by: Amjad Alsharafi <26300843+Amjad50@users.noreply.github.com>
This commit is contained in:
Glenn Jocher
2023-04-05 02:14:52 +02:00
committed by GitHub
parent 4198570a4b
commit 37274c9845
19 changed files with 189 additions and 97 deletions

View File

@ -624,7 +624,8 @@ def get_settings(file=USER_CONFIG_DIR / 'settings.yaml', version='0.0.3'):
# Check that settings keys and types match defaults
correct = \
settings.keys() == defaults.keys() \
settings \
and settings.keys() == defaults.keys() \
and all(type(a) == type(b) for a, b in zip(settings.values(), defaults.values())) \
and check_version(settings['settings_version'], version)
if not correct:
@ -646,6 +647,14 @@ def set_settings(kwargs, file=USER_CONFIG_DIR / 'settings.yaml'):
yaml_save(file, SETTINGS)
def deprecation_warn(arg, new_arg, version=None):
if not version:
version = float(__version__[0:3]) + 0.2 # deprecate after 2nd major release
LOGGER.warning(
f'WARNING: `{arg}` is deprecated and will be removed in upcoming major release {version}. Use `{new_arg}` instead'
)
# Run below code on yolo/utils init ------------------------------------------------------------------------------------
# Check first-install steps