ultralytics 8.0.47 Docker and reformat updates (#1153)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Glenn Jocher
2023-02-25 22:49:19 -08:00
committed by GitHub
parent d4be4cb24b
commit a58f766f94
41 changed files with 224 additions and 201 deletions

View File

@ -269,6 +269,11 @@ def entrypoint(debug=''):
checks.check_yolo()
return
# Task
task = overrides.get('task')
if task and task not in TASKS:
raise ValueError(f"Invalid 'task={task}'. Valid tasks are {TASKS}.\n{CLI_HELP_MSG}")
# Model
model = overrides.pop('model', DEFAULT_CFG.model)
if model is None:
@ -276,15 +281,11 @@ def entrypoint(debug=''):
LOGGER.warning(f"WARNING ⚠️ 'model' is missing. Using default 'model={model}'.")
from ultralytics.yolo.engine.model import YOLO
overrides['model'] = model
model = YOLO(model)
model = YOLO(model, task=task)
# Task
task = overrides.get('task', model.task)
if task is not None:
if task not in TASKS:
raise ValueError(f"Invalid 'task={task}'. Valid tasks are {TASKS}.\n{CLI_HELP_MSG}")
else:
model.task = task
# Task Update
task = task or model.task
overrides['task'] = task
# Mode
if mode in {'predict', 'track'} and 'source' not in overrides: