From b7b70c746bbbe49035f5400ca42b727fee2727d1 Mon Sep 17 00:00:00 2001 From: Ayad Date: Sat, 11 May 2024 17:38:47 +0300 Subject: [PATCH] Update `predict` and `track` method return type (#12101) Co-authored-by: UltralyticsAssistant --- ultralytics/engine/model.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ultralytics/engine/model.py b/ultralytics/engine/model.py index 1d88b2c5..468917cd 100644 --- a/ultralytics/engine/model.py +++ b/ultralytics/engine/model.py @@ -8,6 +8,7 @@ import numpy as np import torch from ultralytics.cfg import TASK2DATA, get_cfg, get_save_dir +from ultralytics.engine.results import Results from ultralytics.hub.utils import HUB_WEB_ROOT from ultralytics.nn.tasks import attempt_load_one_weight, guess_model_task, nn, yaml_model_load from ultralytics.utils import ( @@ -399,7 +400,7 @@ class Model(nn.Module): stream: bool = False, predictor=None, **kwargs, - ) -> list: + ) -> list[Results]: """ Performs predictions on the given image source using the YOLO model. @@ -457,7 +458,7 @@ class Model(nn.Module): stream: bool = False, persist: bool = False, **kwargs, - ) -> list: + ) -> list[Results]: """ Conducts object tracking on the specified input source using the registered trackers.