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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 222 additions and 201 deletions

View file

@ -4,7 +4,7 @@ import torch
from ultralytics.engine.results import Results
from ultralytics.models.yolo.detect.predict import DetectionPredictor
from ultralytics.utils import DEFAULT_CFG, ROOT, ops
from ultralytics.utils import ASSETS, DEFAULT_CFG, ops
class SegmentationPredictor(DetectionPredictor):
@ -47,8 +47,7 @@ class SegmentationPredictor(DetectionPredictor):
def predict(cfg=DEFAULT_CFG, use_python=False):
"""Runs YOLO object detection on an image or video source."""
model = cfg.model or 'yolov8n-seg.pt'
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: