ultralytics 8.0.203 DDP argparse and Tracker fixes (#6007)
This commit is contained in:
parent
ab0b47e386
commit
465df3024f
16 changed files with 50 additions and 22 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
|
||||
__version__ = '8.0.202'
|
||||
__version__ = '8.0.203'
|
||||
|
||||
from ultralytics.models import RTDETR, SAM, YOLO
|
||||
from ultralytics.models.fastsam import FastSAM
|
||||
|
|
|
|||
|
|
@ -192,3 +192,8 @@ class BOTSORT(BYTETracker):
|
|||
def multi_predict(self, tracks):
|
||||
"""Predict and track multiple objects with YOLOv8 model."""
|
||||
BOTrack.multi_predict(tracks)
|
||||
|
||||
def reset(self):
|
||||
"""Reset tracker."""
|
||||
super().reset()
|
||||
self.gmc.reset_params()
|
||||
|
|
|
|||
|
|
@ -374,6 +374,15 @@ class BYTETracker:
|
|||
"""Resets the ID counter of STrack."""
|
||||
STrack.reset_id()
|
||||
|
||||
def reset(self):
|
||||
"""Reset tracker."""
|
||||
self.tracked_stracks = [] # type: list[STrack]
|
||||
self.lost_stracks = [] # type: list[STrack]
|
||||
self.removed_stracks = [] # type: list[STrack]
|
||||
self.frame_id = 0
|
||||
self.kalman_filter = self.get_kalmanfilter()
|
||||
self.reset_id()
|
||||
|
||||
@staticmethod
|
||||
def joint_stracks(tlista, tlistb):
|
||||
"""Combine two lists of stracks into a single one."""
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||
|
||||
from functools import partial
|
||||
from pathlib import Path
|
||||
|
||||
import torch
|
||||
|
||||
|
|
@ -40,8 +41,12 @@ def on_predict_start(predictor, persist=False):
|
|||
def on_predict_postprocess_end(predictor):
|
||||
"""Postprocess detected boxes and update with object tracking."""
|
||||
bs = predictor.dataset.bs
|
||||
im0s = predictor.batch[1]
|
||||
path, im0s = predictor.batch[:2]
|
||||
|
||||
for i in range(bs):
|
||||
if predictor.vid_path[i] != str(predictor.save_dir / Path(path[i]).name): # new video
|
||||
predictor.trackers[i].reset()
|
||||
|
||||
det = predictor.results[i].boxes.cpu().numpy()
|
||||
if len(det) == 0:
|
||||
continue
|
||||
|
|
|
|||
|
|
@ -300,3 +300,10 @@ class GMC:
|
|||
self.prevKeyPoints = copy.copy(keypoints)
|
||||
|
||||
return H
|
||||
|
||||
def reset_params(self):
|
||||
"""Reset parameters."""
|
||||
self.prevFrame = None
|
||||
self.prevKeyPoints = None
|
||||
self.prevDescriptors = None
|
||||
self.initializedFirstFrame = False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue