New ASSETS and trackers GMC cleanup (#4425)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Glenn Jocher
2023-08-17 18:19:05 +02:00
committed by GitHub
parent aaba14e6b2
commit 9d27e7ada4
32 changed files with 222 additions and 201 deletions

View File

@ -4,7 +4,7 @@ import torch
from ultralytics.engine.predictor import BasePredictor
from ultralytics.engine.results import Results
from ultralytics.utils import DEFAULT_CFG, ROOT
from ultralytics.utils import ASSETS, DEFAULT_CFG
class ClassificationPredictor(BasePredictor):
@ -35,8 +35,7 @@ class ClassificationPredictor(BasePredictor):
def predict(cfg=DEFAULT_CFG, use_python=False):
"""Run YOLO model predictions on input images/videos."""
model = cfg.model or 'yolov8n-cls.pt' # or "resnet18"
source = cfg.source if cfg.source is not None else ROOT / 'assets' if (ROOT / 'assets').exists() \
else 'https://ultralytics.com/images/bus.jpg'
source = cfg.source or ASSETS
args = dict(model=model, source=source)
if use_python: