ultralytics 8.3.142__py3-none-any.whl → 8.3.144__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tests/conftest.py +7 -24
- tests/test_cli.py +1 -1
- tests/test_cuda.py +7 -2
- tests/test_engine.py +7 -8
- tests/test_exports.py +16 -16
- tests/test_integrations.py +1 -1
- tests/test_solutions.py +12 -12
- ultralytics/__init__.py +1 -1
- ultralytics/cfg/__init__.py +16 -13
- ultralytics/data/annotator.py +6 -5
- ultralytics/data/augment.py +127 -126
- ultralytics/data/base.py +54 -51
- ultralytics/data/build.py +47 -23
- ultralytics/data/converter.py +47 -43
- ultralytics/data/dataset.py +51 -50
- ultralytics/data/loaders.py +77 -44
- ultralytics/data/split.py +22 -9
- ultralytics/data/split_dota.py +63 -39
- ultralytics/data/utils.py +59 -39
- ultralytics/engine/exporter.py +79 -27
- ultralytics/engine/model.py +39 -39
- ultralytics/engine/predictor.py +37 -28
- ultralytics/engine/results.py +187 -157
- ultralytics/engine/trainer.py +36 -19
- ultralytics/engine/tuner.py +12 -9
- ultralytics/engine/validator.py +7 -9
- ultralytics/hub/__init__.py +11 -13
- ultralytics/hub/auth.py +22 -2
- ultralytics/hub/google/__init__.py +19 -19
- ultralytics/hub/session.py +37 -51
- ultralytics/hub/utils.py +19 -5
- ultralytics/models/fastsam/model.py +30 -12
- ultralytics/models/fastsam/predict.py +5 -6
- ultralytics/models/fastsam/utils.py +3 -3
- ultralytics/models/fastsam/val.py +10 -6
- ultralytics/models/nas/model.py +9 -5
- ultralytics/models/nas/predict.py +6 -6
- ultralytics/models/nas/val.py +3 -3
- ultralytics/models/rtdetr/model.py +7 -6
- ultralytics/models/rtdetr/predict.py +14 -7
- ultralytics/models/rtdetr/train.py +10 -4
- ultralytics/models/rtdetr/val.py +36 -9
- ultralytics/models/sam/amg.py +30 -12
- ultralytics/models/sam/build.py +22 -22
- ultralytics/models/sam/model.py +10 -9
- ultralytics/models/sam/modules/blocks.py +76 -80
- ultralytics/models/sam/modules/decoders.py +6 -8
- ultralytics/models/sam/modules/encoders.py +23 -26
- ultralytics/models/sam/modules/memory_attention.py +13 -1
- ultralytics/models/sam/modules/sam.py +57 -26
- ultralytics/models/sam/modules/tiny_encoder.py +232 -237
- ultralytics/models/sam/modules/transformer.py +13 -13
- ultralytics/models/sam/modules/utils.py +11 -19
- ultralytics/models/sam/predict.py +114 -101
- ultralytics/models/utils/loss.py +98 -77
- ultralytics/models/utils/ops.py +116 -67
- ultralytics/models/yolo/classify/predict.py +5 -5
- ultralytics/models/yolo/classify/train.py +32 -28
- ultralytics/models/yolo/classify/val.py +7 -8
- ultralytics/models/yolo/detect/predict.py +1 -0
- ultralytics/models/yolo/detect/train.py +15 -14
- ultralytics/models/yolo/detect/val.py +37 -36
- ultralytics/models/yolo/model.py +106 -23
- ultralytics/models/yolo/obb/predict.py +3 -4
- ultralytics/models/yolo/obb/train.py +14 -6
- ultralytics/models/yolo/obb/val.py +29 -23
- ultralytics/models/yolo/pose/predict.py +9 -8
- ultralytics/models/yolo/pose/train.py +24 -16
- ultralytics/models/yolo/pose/val.py +44 -26
- ultralytics/models/yolo/segment/predict.py +5 -5
- ultralytics/models/yolo/segment/train.py +11 -7
- ultralytics/models/yolo/segment/val.py +2 -2
- ultralytics/models/yolo/world/train.py +33 -23
- ultralytics/models/yolo/world/train_world.py +11 -3
- ultralytics/models/yolo/yoloe/predict.py +11 -11
- ultralytics/models/yolo/yoloe/train.py +73 -21
- ultralytics/models/yolo/yoloe/train_seg.py +10 -7
- ultralytics/models/yolo/yoloe/val.py +42 -18
- ultralytics/nn/autobackend.py +59 -15
- ultralytics/nn/modules/__init__.py +4 -4
- ultralytics/nn/modules/activation.py +4 -1
- ultralytics/nn/modules/block.py +178 -111
- ultralytics/nn/modules/conv.py +6 -5
- ultralytics/nn/modules/head.py +469 -121
- ultralytics/nn/modules/transformer.py +147 -58
- ultralytics/nn/tasks.py +227 -20
- ultralytics/nn/text_model.py +30 -33
- ultralytics/solutions/ai_gym.py +1 -1
- ultralytics/solutions/analytics.py +7 -4
- ultralytics/solutions/config.py +10 -10
- ultralytics/solutions/distance_calculation.py +11 -10
- ultralytics/solutions/heatmap.py +1 -1
- ultralytics/solutions/instance_segmentation.py +6 -3
- ultralytics/solutions/object_blurrer.py +3 -3
- ultralytics/solutions/object_counter.py +16 -8
- ultralytics/solutions/object_cropper.py +12 -5
- ultralytics/solutions/parking_management.py +29 -28
- ultralytics/solutions/queue_management.py +6 -6
- ultralytics/solutions/region_counter.py +10 -3
- ultralytics/solutions/security_alarm.py +3 -3
- ultralytics/solutions/similarity_search.py +85 -24
- ultralytics/solutions/solutions.py +215 -85
- ultralytics/solutions/speed_estimation.py +28 -22
- ultralytics/solutions/streamlit_inference.py +17 -12
- ultralytics/solutions/trackzone.py +4 -4
- ultralytics/trackers/basetrack.py +16 -23
- ultralytics/trackers/bot_sort.py +30 -20
- ultralytics/trackers/byte_tracker.py +70 -64
- ultralytics/trackers/track.py +4 -8
- ultralytics/trackers/utils/gmc.py +31 -58
- ultralytics/trackers/utils/kalman_filter.py +37 -37
- ultralytics/trackers/utils/matching.py +1 -1
- ultralytics/utils/__init__.py +105 -89
- ultralytics/utils/autobatch.py +16 -3
- ultralytics/utils/autodevice.py +54 -24
- ultralytics/utils/benchmarks.py +42 -28
- ultralytics/utils/callbacks/base.py +3 -3
- ultralytics/utils/callbacks/clearml.py +9 -9
- ultralytics/utils/callbacks/comet.py +67 -25
- ultralytics/utils/callbacks/dvc.py +7 -10
- ultralytics/utils/callbacks/mlflow.py +2 -5
- ultralytics/utils/callbacks/neptune.py +7 -13
- ultralytics/utils/callbacks/raytune.py +1 -1
- ultralytics/utils/callbacks/tensorboard.py +5 -6
- ultralytics/utils/callbacks/wb.py +14 -14
- ultralytics/utils/checks.py +14 -13
- ultralytics/utils/dist.py +5 -5
- ultralytics/utils/downloads.py +94 -67
- ultralytics/utils/errors.py +5 -5
- ultralytics/utils/export.py +61 -47
- ultralytics/utils/files.py +23 -22
- ultralytics/utils/instance.py +48 -52
- ultralytics/utils/loss.py +78 -40
- ultralytics/utils/metrics.py +186 -130
- ultralytics/utils/ops.py +186 -190
- ultralytics/utils/patches.py +15 -17
- ultralytics/utils/plotting.py +71 -27
- ultralytics/utils/tal.py +21 -15
- ultralytics/utils/torch_utils.py +53 -50
- ultralytics/utils/triton.py +5 -4
- ultralytics/utils/tuner.py +5 -5
- {ultralytics-8.3.142.dist-info → ultralytics-8.3.144.dist-info}/METADATA +1 -1
- ultralytics-8.3.144.dist-info/RECORD +272 -0
- ultralytics-8.3.142.dist-info/RECORD +0 -272
- {ultralytics-8.3.142.dist-info → ultralytics-8.3.144.dist-info}/WHEEL +0 -0
- {ultralytics-8.3.142.dist-info → ultralytics-8.3.144.dist-info}/entry_points.txt +0 -0
- {ultralytics-8.3.142.dist-info → ultralytics-8.3.144.dist-info}/licenses/LICENSE +0 -0
- {ultralytics-8.3.142.dist-info → ultralytics-8.3.144.dist-info}/top_level.txt +0 -0
@@ -20,12 +20,12 @@ class KalmanFilterXYAH:
|
|
20
20
|
_std_weight_velocity (float): Standard deviation weight for velocity.
|
21
21
|
|
22
22
|
Methods:
|
23
|
-
initiate:
|
24
|
-
predict:
|
25
|
-
project:
|
26
|
-
multi_predict:
|
27
|
-
update:
|
28
|
-
gating_distance:
|
23
|
+
initiate: Create a track from an unassociated measurement.
|
24
|
+
predict: Run the Kalman filter prediction step.
|
25
|
+
project: Project the state distribution to measurement space.
|
26
|
+
multi_predict: Run the Kalman filter prediction step (vectorized version).
|
27
|
+
update: Run the Kalman filter correction step.
|
28
|
+
gating_distance: Compute the gating distance between state distribution and measurements.
|
29
29
|
|
30
30
|
Examples:
|
31
31
|
Initialize the Kalman filter and create a track from a measurement
|
@@ -70,8 +70,8 @@ class KalmanFilterXYAH:
|
|
70
70
|
and height h.
|
71
71
|
|
72
72
|
Returns:
|
73
|
-
(np.ndarray): Mean vector (8-dimensional) of the new track. Unobserved velocities are initialized to 0 mean.
|
74
|
-
(np.ndarray): Covariance matrix (8x8 dimensional) of the new track.
|
73
|
+
mean (np.ndarray): Mean vector (8-dimensional) of the new track. Unobserved velocities are initialized to 0 mean.
|
74
|
+
covariance (np.ndarray): Covariance matrix (8x8 dimensional) of the new track.
|
75
75
|
|
76
76
|
Examples:
|
77
77
|
>>> kf = KalmanFilterXYAH()
|
@@ -104,8 +104,8 @@ class KalmanFilterXYAH:
|
|
104
104
|
covariance (np.ndarray): The 8x8-dimensional covariance matrix of the object state at the previous time step.
|
105
105
|
|
106
106
|
Returns:
|
107
|
-
(np.ndarray): Mean vector of the predicted state. Unobserved velocities are initialized to 0 mean.
|
108
|
-
(np.ndarray): Covariance matrix of the predicted state.
|
107
|
+
mean (np.ndarray): Mean vector of the predicted state. Unobserved velocities are initialized to 0 mean.
|
108
|
+
covariance (np.ndarray): Covariance matrix of the predicted state.
|
109
109
|
|
110
110
|
Examples:
|
111
111
|
>>> kf = KalmanFilterXYAH()
|
@@ -141,8 +141,8 @@ class KalmanFilterXYAH:
|
|
141
141
|
covariance (np.ndarray): The state's covariance matrix (8x8 dimensional).
|
142
142
|
|
143
143
|
Returns:
|
144
|
-
(np.ndarray): Projected mean of the given state estimate.
|
145
|
-
(np.ndarray): Projected covariance matrix of the given state estimate.
|
144
|
+
mean (np.ndarray): Projected mean of the given state estimate.
|
145
|
+
covariance (np.ndarray): Projected covariance matrix of the given state estimate.
|
146
146
|
|
147
147
|
Examples:
|
148
148
|
>>> kf = KalmanFilterXYAH()
|
@@ -171,8 +171,8 @@ class KalmanFilterXYAH:
|
|
171
171
|
covariance (np.ndarray): The Nx8x8 covariance matrix of the object states at the previous time step.
|
172
172
|
|
173
173
|
Returns:
|
174
|
-
(np.ndarray): Mean matrix of the predicted states with shape (N, 8).
|
175
|
-
(np.ndarray): Covariance matrix of the predicted states with shape (N, 8, 8).
|
174
|
+
mean (np.ndarray): Mean matrix of the predicted states with shape (N, 8).
|
175
|
+
covariance (np.ndarray): Covariance matrix of the predicted states with shape (N, 8, 8).
|
176
176
|
|
177
177
|
Examples:
|
178
178
|
>>> mean = np.random.rand(10, 8) # 10 object states
|
@@ -213,8 +213,8 @@ class KalmanFilterXYAH:
|
|
213
213
|
position, a the aspect ratio, and h the height of the bounding box.
|
214
214
|
|
215
215
|
Returns:
|
216
|
-
(np.ndarray): Measurement-corrected state mean.
|
217
|
-
(np.ndarray): Measurement-corrected state covariance.
|
216
|
+
new_mean (np.ndarray): Measurement-corrected state mean.
|
217
|
+
new_covariance (np.ndarray): Measurement-corrected state covariance.
|
218
218
|
|
219
219
|
Examples:
|
220
220
|
>>> kf = KalmanFilterXYAH()
|
@@ -254,8 +254,8 @@ class KalmanFilterXYAH:
|
|
254
254
|
covariance (np.ndarray): Covariance of the state distribution (8x8 dimensional).
|
255
255
|
measurements (np.ndarray): An (N, 4) matrix of N measurements, each in format (x, y, a, h) where (x, y) is the
|
256
256
|
bounding box center position, a the aspect ratio, and h the height.
|
257
|
-
only_position (bool): If True, distance computation is done with respect to box center position only.
|
258
|
-
metric (str): The metric to use for calculating the distance. Options are 'gaussian' for the squared
|
257
|
+
only_position (bool, optional): If True, distance computation is done with respect to box center position only.
|
258
|
+
metric (str, optional): The metric to use for calculating the distance. Options are 'gaussian' for the squared
|
259
259
|
Euclidean distance and 'maha' for the squared Mahalanobis distance.
|
260
260
|
|
261
261
|
Returns:
|
@@ -302,11 +302,11 @@ class KalmanFilterXYWH(KalmanFilterXYAH):
|
|
302
302
|
_std_weight_velocity (float): Standard deviation weight for velocity.
|
303
303
|
|
304
304
|
Methods:
|
305
|
-
initiate:
|
306
|
-
predict:
|
307
|
-
project:
|
308
|
-
multi_predict:
|
309
|
-
update:
|
305
|
+
initiate: Create a track from an unassociated measurement.
|
306
|
+
predict: Run the Kalman filter prediction step.
|
307
|
+
project: Project the state distribution to measurement space.
|
308
|
+
multi_predict: Run the Kalman filter prediction step in a vectorized manner.
|
309
|
+
update: Run the Kalman filter correction step.
|
310
310
|
|
311
311
|
Examples:
|
312
312
|
Create a Kalman filter and initialize a track
|
@@ -325,8 +325,8 @@ class KalmanFilterXYWH(KalmanFilterXYAH):
|
|
325
325
|
measurement (np.ndarray): Bounding box coordinates (x, y, w, h) with center position (x, y), width, and height.
|
326
326
|
|
327
327
|
Returns:
|
328
|
-
(np.ndarray): Mean vector (8 dimensional) of the new track. Unobserved velocities are initialized to 0 mean.
|
329
|
-
(np.ndarray): Covariance matrix (8x8 dimensional) of the new track.
|
328
|
+
mean (np.ndarray): Mean vector (8 dimensional) of the new track. Unobserved velocities are initialized to 0 mean.
|
329
|
+
covariance (np.ndarray): Covariance matrix (8x8 dimensional) of the new track.
|
330
330
|
|
331
331
|
Examples:
|
332
332
|
>>> kf = KalmanFilterXYWH()
|
@@ -361,7 +361,7 @@ class KalmanFilterXYWH(KalmanFilterXYAH):
|
|
361
361
|
covariance = np.diag(np.square(std))
|
362
362
|
return mean, covariance
|
363
363
|
|
364
|
-
def predict(self, mean, covariance):
|
364
|
+
def predict(self, mean: np.ndarray, covariance: np.ndarray):
|
365
365
|
"""
|
366
366
|
Run Kalman filter prediction step.
|
367
367
|
|
@@ -370,8 +370,8 @@ class KalmanFilterXYWH(KalmanFilterXYAH):
|
|
370
370
|
covariance (np.ndarray): The 8x8-dimensional covariance matrix of the object state at the previous time step.
|
371
371
|
|
372
372
|
Returns:
|
373
|
-
(np.ndarray): Mean vector of the predicted state. Unobserved velocities are initialized to 0 mean.
|
374
|
-
(np.ndarray): Covariance matrix of the predicted state.
|
373
|
+
mean (np.ndarray): Mean vector of the predicted state. Unobserved velocities are initialized to 0 mean.
|
374
|
+
covariance (np.ndarray): Covariance matrix of the predicted state.
|
375
375
|
|
376
376
|
Examples:
|
377
377
|
>>> kf = KalmanFilterXYWH()
|
@@ -398,7 +398,7 @@ class KalmanFilterXYWH(KalmanFilterXYAH):
|
|
398
398
|
|
399
399
|
return mean, covariance
|
400
400
|
|
401
|
-
def project(self, mean, covariance):
|
401
|
+
def project(self, mean: np.ndarray, covariance: np.ndarray):
|
402
402
|
"""
|
403
403
|
Project state distribution to measurement space.
|
404
404
|
|
@@ -407,8 +407,8 @@ class KalmanFilterXYWH(KalmanFilterXYAH):
|
|
407
407
|
covariance (np.ndarray): The state's covariance matrix (8x8 dimensional).
|
408
408
|
|
409
409
|
Returns:
|
410
|
-
(np.ndarray): Projected mean of the given state estimate.
|
411
|
-
(np.ndarray): Projected covariance matrix of the given state estimate.
|
410
|
+
mean (np.ndarray): Projected mean of the given state estimate.
|
411
|
+
covariance (np.ndarray): Projected covariance matrix of the given state estimate.
|
412
412
|
|
413
413
|
Examples:
|
414
414
|
>>> kf = KalmanFilterXYWH()
|
@@ -428,7 +428,7 @@ class KalmanFilterXYWH(KalmanFilterXYAH):
|
|
428
428
|
covariance = np.linalg.multi_dot((self._update_mat, covariance, self._update_mat.T))
|
429
429
|
return mean, covariance + innovation_cov
|
430
430
|
|
431
|
-
def multi_predict(self, mean, covariance):
|
431
|
+
def multi_predict(self, mean: np.ndarray, covariance: np.ndarray):
|
432
432
|
"""
|
433
433
|
Run Kalman filter prediction step (Vectorized version).
|
434
434
|
|
@@ -437,8 +437,8 @@ class KalmanFilterXYWH(KalmanFilterXYAH):
|
|
437
437
|
covariance (np.ndarray): The Nx8x8 covariance matrix of the object states at the previous time step.
|
438
438
|
|
439
439
|
Returns:
|
440
|
-
(np.ndarray): Mean matrix of the predicted states with shape (N, 8).
|
441
|
-
(np.ndarray): Covariance matrix of the predicted states with shape (N, 8, 8).
|
440
|
+
mean (np.ndarray): Mean matrix of the predicted states with shape (N, 8).
|
441
|
+
covariance (np.ndarray): Covariance matrix of the predicted states with shape (N, 8, 8).
|
442
442
|
|
443
443
|
Examples:
|
444
444
|
>>> mean = np.random.rand(5, 8) # 5 objects with 8-dimensional state vectors
|
@@ -469,7 +469,7 @@ class KalmanFilterXYWH(KalmanFilterXYAH):
|
|
469
469
|
|
470
470
|
return mean, covariance
|
471
471
|
|
472
|
-
def update(self, mean, covariance, measurement):
|
472
|
+
def update(self, mean: np.ndarray, covariance: np.ndarray, measurement: np.ndarray):
|
473
473
|
"""
|
474
474
|
Run Kalman filter correction step.
|
475
475
|
|
@@ -480,8 +480,8 @@ class KalmanFilterXYWH(KalmanFilterXYAH):
|
|
480
480
|
position, w the width, and h the height of the bounding box.
|
481
481
|
|
482
482
|
Returns:
|
483
|
-
(np.ndarray): Measurement-corrected state mean.
|
484
|
-
(np.ndarray): Measurement-corrected state covariance.
|
483
|
+
new_mean (np.ndarray): Measurement-corrected state mean.
|
484
|
+
new_covariance (np.ndarray): Measurement-corrected state covariance.
|
485
485
|
|
486
486
|
Examples:
|
487
487
|
>>> kf = KalmanFilterXYWH()
|
@@ -17,7 +17,7 @@ except (ImportError, AssertionError, AttributeError):
|
|
17
17
|
import lap
|
18
18
|
|
19
19
|
|
20
|
-
def linear_assignment(cost_matrix: np.ndarray, thresh: float, use_lap: bool = True)
|
20
|
+
def linear_assignment(cost_matrix: np.ndarray, thresh: float, use_lap: bool = True):
|
21
21
|
"""
|
22
22
|
Perform linear assignment using either the scipy or lap.lapjv method.
|
23
23
|
|