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
|
|
@ -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