diff --git a/docker/Dockerfile-cpu b/docker/Dockerfile-cpu index 65326daa..42e5ec32 100644 --- a/docker/Dockerfile-cpu +++ b/docker/Dockerfile-cpu @@ -3,7 +3,7 @@ # Image is CPU-optimized for ONNX, OpenVINO and PyTorch YOLOv8 deployments # Start FROM Ubuntu image https://hub.docker.com/_/ubuntu -FROM ubuntu:mantic-20231011 +FROM ubuntu:23.10 # Downloads to user config dir ADD https://ultralytics.com/assets/Arial.ttf https://ultralytics.com/assets/Arial.Unicode.ttf /root/.config/Ultralytics/ diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index 2fb0250f..1609c3ab 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics YOLO 🚀, AGPL-3.0 license -__version__ = '8.0.221' +__version__ = '8.0.222' from ultralytics.models import RTDETR, SAM, YOLO from ultralytics.models.fastsam import FastSAM diff --git a/ultralytics/engine/results.py b/ultralytics/engine/results.py index da145e46..3feabbc1 100644 --- a/ultralytics/engine/results.py +++ b/ultralytics/engine/results.py @@ -323,7 +323,7 @@ class Results(SimpleClass): for d in self.boxes: save_one_box(d.xyxy, self.orig_img.copy(), - file=Path(save_dir) / self.names[int(d.cls)] / f'{Path(file_name).stem}.jpg', + file=Path(save_dir) / self.names[int(d.cls)] / f'{Path(file_name)}.jpg', BGR=True) def tojson(self, normalize=False): diff --git a/ultralytics/trackers/utils/gmc.py b/ultralytics/trackers/utils/gmc.py index a774def9..1e801b4a 100644 --- a/ultralytics/trackers/utils/gmc.py +++ b/ultralytics/trackers/utils/gmc.py @@ -89,7 +89,7 @@ class GMC: detections (list): List of detections to be used in the processing. Returns: - np.array: Processed frame. + (np.array): Processed frame. Examples: >>> gmc = GMC() @@ -115,7 +115,7 @@ class GMC: detections (list): List of detections to be used in the processing. Returns: - np.array: Processed frame. + (np.array): Processed frame. Examples: >>> gmc = GMC() @@ -162,7 +162,7 @@ class GMC: detections (list): List of detections to be used in the processing. Returns: - np.array: Processed frame. + (np.array): Processed frame. Examples: >>> gmc = GMC() @@ -301,7 +301,7 @@ class GMC: detections (list): List of detections to be used in the processing. Returns: - np.array: Processed frame. + (np.array): Processed frame. Examples: >>> gmc = GMC() diff --git a/ultralytics/trackers/utils/kalman_filter.py b/ultralytics/trackers/utils/kalman_filter.py index 4589c770..b4fb91fc 100644 --- a/ultralytics/trackers/utils/kalman_filter.py +++ b/ultralytics/trackers/utils/kalman_filter.py @@ -39,7 +39,7 @@ class KalmanFilterXYAH: and height h. Returns: - tuple[ndarray, ndarray]: Returns the mean vector (8 dimensional) and covariance matrix (8x8 dimensional) of + (tuple[ndarray, ndarray]): Returns the mean vector (8 dimensional) and covariance matrix (8x8 dimensional) of the new track. Unobserved velocities are initialized to 0 mean. """ mean_pos = measurement @@ -62,7 +62,7 @@ class KalmanFilterXYAH: covariance (ndarray): The 8x8 dimensional covariance matrix of the object state at the previous time step. Returns: - tuple[ndarray, ndarray]: Returns the mean vector and covariance matrix of the predicted state. Unobserved + (tuple[ndarray, ndarray]): Returns the mean vector and covariance matrix of the predicted state. Unobserved velocities are initialized to 0 mean. """ std_pos = [ @@ -87,7 +87,7 @@ class KalmanFilterXYAH: covariance (ndarray): The state's covariance matrix (8x8 dimensional). Returns: - tuple[ndarray, ndarray]: Returns the projected mean and covariance matrix of the given state estimate. + (tuple[ndarray, ndarray]): Returns the projected mean and covariance matrix of the given state estimate. """ std = [ self._std_weight_position * mean[3], self._std_weight_position * mean[3], 1e-1, @@ -107,7 +107,7 @@ class KalmanFilterXYAH: covariance (ndarray): The Nx8x8 covariance matrix of the object states at the previous time step. Returns: - tuple[ndarray, ndarray]: Returns the mean vector and covariance matrix of the predicted state. Unobserved + (tuple[ndarray, ndarray]): Returns the mean vector and covariance matrix of the predicted state. Unobserved velocities are initialized to 0 mean. """ std_pos = [ @@ -138,7 +138,7 @@ class KalmanFilterXYAH: position, a the aspect ratio, and h the height of the bounding box. Returns: - tuple[ndarray, ndarray]: Returns the measurement-corrected state distribution. + (tuple[ndarray, ndarray]): Returns the measurement-corrected state distribution. """ projected_mean, projected_cov = self.project(mean, covariance) @@ -174,7 +174,7 @@ class KalmanFilterXYAH: squared Euclidean distance and 'maha' for the squared Mahalanobis distance. Defaults to 'maha'. Returns: - ndarray: Returns an array of length N, where the i-th element contains the squared distance between + (np.ndarray): Returns an array of length N, where the i-th element contains the squared distance between (mean, covariance) and `measurements[i]`. """ mean, covariance = self.project(mean, covariance) @@ -212,7 +212,7 @@ class KalmanFilterXYWH(KalmanFilterXYAH): measurement (ndarray): Bounding box coordinates (x, y, w, h) with center position (x, y), width, and height. Returns: - tuple[ndarray, ndarray]: Returns the mean vector (8 dimensional) and covariance matrix (8x8 dimensional) of + (tuple[ndarray, ndarray]): Returns the mean vector (8 dimensional) and covariance matrix (8x8 dimensional) of the new track. Unobserved velocities are initialized to 0 mean. """ mean_pos = measurement @@ -236,7 +236,7 @@ class KalmanFilterXYWH(KalmanFilterXYAH): covariance (ndarray): The 8x8 dimensional covariance matrix of the object state at the previous time step. Returns: - tuple[ndarray, ndarray]: Returns the mean vector and covariance matrix of the predicted state. Unobserved + (tuple[ndarray, ndarray]): Returns the mean vector and covariance matrix of the predicted state. Unobserved velocities are initialized to 0 mean. """ std_pos = [ @@ -261,7 +261,7 @@ class KalmanFilterXYWH(KalmanFilterXYAH): covariance (ndarray): The state's covariance matrix (8x8 dimensional). Returns: - tuple[ndarray, ndarray]: Returns the projected mean and covariance matrix of the given state estimate. + (tuple[ndarray, ndarray]): Returns the projected mean and covariance matrix of the given state estimate. """ std = [ self._std_weight_position * mean[2], self._std_weight_position * mean[3], @@ -281,7 +281,7 @@ class KalmanFilterXYWH(KalmanFilterXYAH): covariance (ndarray): The Nx8x8 covariance matrix of the object states at the previous time step. Returns: - tuple[ndarray, ndarray]: Returns the mean vector and covariance matrix of the predicted state. Unobserved + (tuple[ndarray, ndarray]): Returns the mean vector and covariance matrix of the predicted state. Unobserved velocities are initialized to 0 mean. """ std_pos = [ @@ -309,9 +309,9 @@ class KalmanFilterXYWH(KalmanFilterXYAH): mean (ndarray): The predicted state's mean vector (8 dimensional). covariance (ndarray): The state's covariance matrix (8x8 dimensional). measurement (ndarray): The 4 dimensional measurement vector (x, y, w, h), where (x, y) is the center - position, w the width, and h the height of the bounding box. + position, w the width, and h the height of the bounding box. Returns: - tuple[ndarray, ndarray]: Returns the measurement-corrected state distribution. + (tuple[ndarray, ndarray]): Returns the measurement-corrected state distribution. """ return super().update(mean, covariance, measurement) diff --git a/ultralytics/trackers/utils/matching.py b/ultralytics/trackers/utils/matching.py index c338a0ef..b2df4bd1 100644 --- a/ultralytics/trackers/utils/matching.py +++ b/ultralytics/trackers/utils/matching.py @@ -67,7 +67,7 @@ def iou_distance(atracks: list, btracks: list) -> np.ndarray: btracks (list[STrack] | list[np.ndarray]): List of tracks 'b' or bounding boxes. Returns: - np.ndarray: Cost matrix computed based on IoU. + (np.ndarray): Cost matrix computed based on IoU. """ if (len(atracks) > 0 and isinstance(atracks[0], np.ndarray)) \ @@ -96,7 +96,7 @@ def embedding_distance(tracks: list, detections: list, metric: str = 'cosine') - metric (str, optional): Metric for distance computation. Defaults to 'cosine'. Returns: - np.ndarray: Cost matrix computed based on embeddings. + (np.ndarray): Cost matrix computed based on embeddings. """ cost_matrix = np.zeros((len(tracks), len(detections)), dtype=np.float32) @@ -119,7 +119,7 @@ def fuse_score(cost_matrix: np.ndarray, detections: list) -> np.ndarray: detections (list[BaseTrack]): List of detections with scores. Returns: - np.ndarray: Fused similarity matrix. + (np.ndarray): Fused similarity matrix. """ if cost_matrix.size == 0: