Move task=classify with mode=track warning to tracker on_predict_start (#18837)
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
d6272f258e
commit
d29023f85f
2 changed files with 4 additions and 6 deletions
|
|
@ -921,12 +921,7 @@ def entrypoint(debug=""):
|
|||
# Task
|
||||
task = overrides.pop("task", None)
|
||||
if task:
|
||||
if task == "classify" and mode == "track":
|
||||
raise ValueError(
|
||||
f"❌ Classification doesn't support 'mode=track'. Valid modes for classification are"
|
||||
f" {MODES - {'track'}}.\n{CLI_HELP_MSG}"
|
||||
)
|
||||
elif task not in TASKS:
|
||||
if task not in TASKS:
|
||||
if task == "track":
|
||||
LOGGER.warning(
|
||||
"WARNING ⚠️ invalid 'task=track', setting 'task=detect' and 'mode=track'. Valid tasks are {TASKS}.\n{CLI_HELP_MSG}."
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@ def on_predict_start(predictor: object, persist: bool = False) -> None:
|
|||
>>> predictor = SomePredictorClass()
|
||||
>>> on_predict_start(predictor, persist=True)
|
||||
"""
|
||||
if predictor.args.task == "classify":
|
||||
raise ValueError("❌ Classification doesn't support 'mode=track'")
|
||||
|
||||
if hasattr(predictor, "trackers") and persist:
|
||||
return
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue