ultralytics 8.3.147__py3-none-any.whl → 8.3.149__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.
- ultralytics/__init__.py +1 -1
- ultralytics/data/dataset.py +1 -1
- ultralytics/data/loaders.py +1 -2
- ultralytics/engine/exporter.py +3 -3
- ultralytics/engine/predictor.py +17 -10
- ultralytics/nn/tasks.py +6 -0
- ultralytics/utils/metrics.py +19 -3
- {ultralytics-8.3.147.dist-info → ultralytics-8.3.149.dist-info}/METADATA +1 -1
- {ultralytics-8.3.147.dist-info → ultralytics-8.3.149.dist-info}/RECORD +13 -13
- {ultralytics-8.3.147.dist-info → ultralytics-8.3.149.dist-info}/WHEEL +0 -0
- {ultralytics-8.3.147.dist-info → ultralytics-8.3.149.dist-info}/entry_points.txt +0 -0
- {ultralytics-8.3.147.dist-info → ultralytics-8.3.149.dist-info}/licenses/LICENSE +0 -0
- {ultralytics-8.3.147.dist-info → ultralytics-8.3.149.dist-info}/top_level.txt +0 -0
ultralytics/__init__.py
CHANGED
ultralytics/data/dataset.py
CHANGED
@@ -577,7 +577,7 @@ class GroundingDataset(YOLODataset):
|
|
577
577
|
cache, _ = load_dataset_cache_file(cache_path), True # attempt to load a *.cache file
|
578
578
|
assert cache["version"] == DATASET_CACHE_VERSION # matches current version
|
579
579
|
assert cache["hash"] == get_hash(self.json_file) # identical hash
|
580
|
-
except (FileNotFoundError, AssertionError, AttributeError):
|
580
|
+
except (FileNotFoundError, AssertionError, AttributeError, ModuleNotFoundError):
|
581
581
|
cache, _ = self.cache_labels(cache_path), False # run cache ops
|
582
582
|
[cache.pop(k) for k in ("hash", "version")] # remove items
|
583
583
|
labels = cache["labels"]
|
ultralytics/data/loaders.py
CHANGED
@@ -186,7 +186,6 @@ class LoadStreams:
|
|
186
186
|
cap.release() # release video capture
|
187
187
|
except Exception as e:
|
188
188
|
LOGGER.warning(f"Could not release VideoCapture object: {e}")
|
189
|
-
cv2.destroyAllWindows()
|
190
189
|
|
191
190
|
def __iter__(self):
|
192
191
|
"""Iterate through YOLO image feed and re-open unresponsive streams."""
|
@@ -201,7 +200,7 @@ class LoadStreams:
|
|
201
200
|
for i, x in enumerate(self.imgs):
|
202
201
|
# Wait until a frame is available in each buffer
|
203
202
|
while not x:
|
204
|
-
if not self.threads[i].is_alive()
|
203
|
+
if not self.threads[i].is_alive():
|
205
204
|
self.close()
|
206
205
|
raise StopIteration
|
207
206
|
time.sleep(1 / min(self.fps))
|
ultralytics/engine/exporter.py
CHANGED
@@ -598,7 +598,7 @@ class Exporter:
|
|
598
598
|
"""Export YOLO model to ONNX format."""
|
599
599
|
requirements = ["onnx>=1.12.0,<1.18.0"]
|
600
600
|
if self.args.simplify:
|
601
|
-
requirements += ["onnxslim>=0.1.
|
601
|
+
requirements += ["onnxslim>=0.1.56", "onnxruntime" + ("-gpu" if torch.cuda.is_available() else "")]
|
602
602
|
check_requirements(requirements)
|
603
603
|
import onnx # noqa
|
604
604
|
|
@@ -969,7 +969,7 @@ class Exporter:
|
|
969
969
|
"ai-edge-litert>=1.2.0", # required by 'onnx2tf' package
|
970
970
|
"onnx>=1.12.0,<1.18.0",
|
971
971
|
"onnx2tf>=1.26.3",
|
972
|
-
"onnxslim>=0.1.
|
972
|
+
"onnxslim>=0.1.56",
|
973
973
|
"onnxruntime-gpu" if cuda else "onnxruntime",
|
974
974
|
"protobuf>=5",
|
975
975
|
),
|
@@ -1023,7 +1023,7 @@ class Exporter:
|
|
1023
1023
|
custom_input_op_name_np_data_path=np_data,
|
1024
1024
|
enable_batchmatmul_unfold=True, # fix lower no. of detected objects on GPU delegate
|
1025
1025
|
output_signaturedefs=True, # fix error with Attention block group convolution
|
1026
|
-
disable_group_convolution=self.args.format
|
1026
|
+
disable_group_convolution=self.args.format in {"tfjs", "edgetpu"}, # fix error with group convolution
|
1027
1027
|
optimization_for_gpu_delegate=True,
|
1028
1028
|
)
|
1029
1029
|
YAML.save(f / "metadata.yaml", self.metadata) # add metadata.yaml
|
ultralytics/engine/predictor.py
CHANGED
@@ -339,15 +339,18 @@ class BasePredictor:
|
|
339
339
|
|
340
340
|
# Visualize, save, write results
|
341
341
|
n = len(im0s)
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
342
|
+
try:
|
343
|
+
for i in range(n):
|
344
|
+
self.seen += 1
|
345
|
+
self.results[i].speed = {
|
346
|
+
"preprocess": profilers[0].dt * 1e3 / n,
|
347
|
+
"inference": profilers[1].dt * 1e3 / n,
|
348
|
+
"postprocess": profilers[2].dt * 1e3 / n,
|
349
|
+
}
|
350
|
+
if self.args.verbose or self.args.save or self.args.save_txt or self.args.show:
|
351
|
+
s[i] += self.write_results(i, Path(paths[i]), im, s)
|
352
|
+
except StopIteration:
|
353
|
+
break
|
351
354
|
|
352
355
|
# Print batch results
|
353
356
|
if self.args.verbose:
|
@@ -361,6 +364,9 @@ class BasePredictor:
|
|
361
364
|
if isinstance(v, cv2.VideoWriter):
|
362
365
|
v.release()
|
363
366
|
|
367
|
+
if self.args.show:
|
368
|
+
cv2.destroyAllWindows() # close any open windows
|
369
|
+
|
364
370
|
# Print final results
|
365
371
|
if self.args.verbose and self.seen:
|
366
372
|
t = tuple(x.t / self.seen * 1e3 for x in profilers) # speeds per image
|
@@ -492,7 +498,8 @@ class BasePredictor:
|
|
492
498
|
cv2.namedWindow(p, cv2.WINDOW_NORMAL | cv2.WINDOW_KEEPRATIO) # allow window resize (Linux)
|
493
499
|
cv2.resizeWindow(p, im.shape[1], im.shape[0]) # (width, height)
|
494
500
|
cv2.imshow(p, im)
|
495
|
-
cv2.waitKey(300 if self.dataset.mode == "image" else 1) #
|
501
|
+
if cv2.waitKey(300 if self.dataset.mode == "image" else 1) & 0xFF == ord("q"): # 300ms if image; else 1ms
|
502
|
+
raise StopIteration
|
496
503
|
|
497
504
|
def run_callbacks(self, event: str):
|
498
505
|
"""Run all registered callbacks for a specific event."""
|
ultralytics/nn/tasks.py
CHANGED
@@ -1457,6 +1457,12 @@ def torch_safe_load(weight, safe_only=False):
|
|
1457
1457
|
f"run a command with an official Ultralytics model, i.e. 'yolo predict model=yolo11n.pt'"
|
1458
1458
|
)
|
1459
1459
|
) from e
|
1460
|
+
elif e.name == "numpy._core":
|
1461
|
+
raise ModuleNotFoundError(
|
1462
|
+
emojis(
|
1463
|
+
f"ERROR ❌️ {weight} requires numpy>=1.26.1, however numpy=={__import__('numpy').__version__} is installed."
|
1464
|
+
)
|
1465
|
+
) from e
|
1460
1466
|
LOGGER.warning(
|
1461
1467
|
f"{weight} appears to require '{e.name}', which is not in Ultralytics requirements."
|
1462
1468
|
f"\nAutoInstall will run now for '{e.name}' but this feature will be removed in the future."
|
ultralytics/utils/metrics.py
CHANGED
@@ -505,8 +505,23 @@ class ConfusionMatrix(DataExportMixin):
|
|
505
505
|
for i in range(self.matrix.shape[0]):
|
506
506
|
LOGGER.info(" ".join(map(str, self.matrix[i])))
|
507
507
|
|
508
|
-
def summary(self,
|
509
|
-
"""
|
508
|
+
def summary(self, normalize: bool = False, decimals: int = 5) -> List[Dict[str, float]]:
|
509
|
+
"""
|
510
|
+
Generate a summarized representation of the confusion matrix as a list of dictionaries, with optional
|
511
|
+
normalization. This is useful for exporting the matrix to various formats such as CSV, XML, HTML, JSON, or SQL.
|
512
|
+
|
513
|
+
Args:
|
514
|
+
normalize (bool): Whether to normalize the confusion matrix values.
|
515
|
+
decimals (int): Number of decimal places to round the output values to.
|
516
|
+
|
517
|
+
Returns:
|
518
|
+
List[Dict[str, float]]: A list of dictionaries, each representing one predicted class with corresponding values for all actual classes.
|
519
|
+
|
520
|
+
Examples:
|
521
|
+
>>> results = model.val(data="coco8.yaml", plots=True)
|
522
|
+
>>> cm_dict = results.confusion_matrix.summary(normalize=True, decimals=5)
|
523
|
+
>>> print(cm_dict)
|
524
|
+
"""
|
510
525
|
import re
|
511
526
|
|
512
527
|
names = self.names if self.task == "classify" else self.names + ["background"]
|
@@ -520,8 +535,9 @@ class ConfusionMatrix(DataExportMixin):
|
|
520
535
|
counter += 1
|
521
536
|
seen.add(clean_name.lower())
|
522
537
|
clean_names.append(clean_name)
|
538
|
+
array = (self.matrix / ((self.matrix.sum(0).reshape(1, -1) + 1e-9) if normalize else 1)).round(decimals)
|
523
539
|
return [
|
524
|
-
dict({"Predicted": clean_names[i]}, **{clean_names[j]:
|
540
|
+
dict({"Predicted": clean_names[i]}, **{clean_names[j]: array[i, j] for j in range(len(clean_names))})
|
525
541
|
for i in range(len(clean_names))
|
526
542
|
]
|
527
543
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ultralytics
|
3
|
-
Version: 8.3.
|
3
|
+
Version: 8.3.149
|
4
4
|
Summary: Ultralytics YOLO 🚀 for SOTA object detection, multi-object tracking, instance segmentation, pose estimation and image classification.
|
5
5
|
Author-email: Glenn Jocher <glenn.jocher@ultralytics.com>, Jing Qiu <jing.qiu@ultralytics.com>
|
6
6
|
Maintainer-email: Ultralytics <hello@ultralytics.com>
|
@@ -7,7 +7,7 @@ tests/test_exports.py,sha256=HmMKOTCia9ZDC0VYc_EPmvBTM5LM5eeI1NF_pKjLpd8,9677
|
|
7
7
|
tests/test_integrations.py,sha256=cQfgueFhEZ8Xs-tF0uiIEhvn0DlhOH-Wqrx96LXp3D0,6303
|
8
8
|
tests/test_python.py,sha256=_7xc7mqQxw3OsLhAdx-P85u9sqkfIXVhIloxmhBXph4,27800
|
9
9
|
tests/test_solutions.py,sha256=tuf6n_fsI8KvSdJrnc-cqP2qYdiYqCWuVrx0z9dOz3Q,13213
|
10
|
-
ultralytics/__init__.py,sha256=
|
10
|
+
ultralytics/__init__.py,sha256=rxv35SPIqrpbl0NgnfyI3xFT3wCU9es9rJk77BGrhmo,730
|
11
11
|
ultralytics/assets/bus.jpg,sha256=wCAZxJecGR63Od3ZRERe9Aja1Weayrb9Ug751DS_vGM,137419
|
12
12
|
ultralytics/assets/zidane.jpg,sha256=Ftc4aeMmen1O0A3o6GCDO9FlfBslLpTAw0gnetx7bts,50427
|
13
13
|
ultralytics/cfg/__init__.py,sha256=H19EalaxuIa44J_nVBrNxMj8EAPmlZl3ecbX0-xK8y8,39600
|
@@ -109,8 +109,8 @@ ultralytics/data/augment.py,sha256=fvYug6B0qrSSS8IYpvdju9uENnEJWCf-GNG5WqIayng,1
|
|
109
109
|
ultralytics/data/base.py,sha256=mRcuehK1thNuuzQGL6D1AaZkod71oHRdYTod_zdQZQg,19688
|
110
110
|
ultralytics/data/build.py,sha256=Djz6stD1FXmFhnoUJp-MKp7geu-k3xhnvt9kfXFKGhI,11020
|
111
111
|
ultralytics/data/converter.py,sha256=oKW8ODtvFOKBx9Un8n87xUUm3b5GStU4ViIBH5UDylM,27200
|
112
|
-
ultralytics/data/dataset.py,sha256=
|
113
|
-
ultralytics/data/loaders.py,sha256=
|
112
|
+
ultralytics/data/dataset.py,sha256=bVi1yTfQKJGKItMDTYzIE6MIEPpWqzXnUqra5AXmV18,35443
|
113
|
+
ultralytics/data/loaders.py,sha256=kTGO1P-HntpQk078i1ASyXYckDx9Z7Pe7o1YbePcjC4,31657
|
114
114
|
ultralytics/data/split.py,sha256=qOHZwsHi3I1IKLgLfcz7jH3CTibeJUDyjo7HwNtB_kk,5121
|
115
115
|
ultralytics/data/split_dota.py,sha256=RJHxwOX2Z9CfSX_h7L7mO-aLQ4Ap_ZpZanQdno10oSA,12893
|
116
116
|
ultralytics/data/utils.py,sha256=fJqVJkjaub-xT0cB1o40Hl1WIH1ljKINT0SJaJyZse4,36637
|
@@ -119,9 +119,9 @@ ultralytics/data/scripts/get_coco.sh,sha256=UuJpJeo3qQpTHVINeOpmP0NYmg8PhEFE3A8J
|
|
119
119
|
ultralytics/data/scripts/get_coco128.sh,sha256=qmRQl_hOKrsdHrTrnyQuFIH01oDz3lfaz138OgGfLt8,650
|
120
120
|
ultralytics/data/scripts/get_imagenet.sh,sha256=hr42H16bM47iT27rgS7MpEo-GeOZAYUQXgr0B2cwn48,1705
|
121
121
|
ultralytics/engine/__init__.py,sha256=lm6MckFYCPTbqIoX7w0s_daxdjNeBeKW6DXppv1-QUM,70
|
122
|
-
ultralytics/engine/exporter.py,sha256=
|
122
|
+
ultralytics/engine/exporter.py,sha256=rcLRaEWzPGGtAarfasw14HwQAypNng-QnsHj8U1vz_k,73909
|
123
123
|
ultralytics/engine/model.py,sha256=0Yslj0TPWi25CELtVQs1dRzJyJAw9-tWTlDbC6kJ0pA,53310
|
124
|
-
ultralytics/engine/predictor.py,sha256=
|
124
|
+
ultralytics/engine/predictor.py,sha256=e45PyndZDtR-JJ7Sm6HyKm9n_7h7RTWGEpo4jTCepg4,22428
|
125
125
|
ultralytics/engine/results.py,sha256=Mb8pBTOrBtQh0PQtGVbhRZ_C1VyqYFumjLggiKCRIJs,72295
|
126
126
|
ultralytics/engine/trainer.py,sha256=zZ2Lm7VJOlBX-Ya52ec3n3IlSn9_yM5fbsRIWGeGOyo,39556
|
127
127
|
ultralytics/engine/tuner.py,sha256=4ue7JbMFQp7JcWhhwCAY-b-xZsjm5VKVlPFDUTyxt_8,12789
|
@@ -195,7 +195,7 @@ ultralytics/models/yolo/yoloe/train_seg.py,sha256=aCV7M8oQOvODFnU4piZdJh3tIrBJYA
|
|
195
195
|
ultralytics/models/yolo/yoloe/val.py,sha256=Y0oCiqGvj8LHLrvnfPPUADSj_zNp68BVdpgcER4999E,9736
|
196
196
|
ultralytics/nn/__init__.py,sha256=rjociYD9lo_K-d-1s6TbdWklPLjTcEHk7OIlRDJstIE,615
|
197
197
|
ultralytics/nn/autobackend.py,sha256=uTOQyQ4v0_IZvvqAHnDsAxJv3QKe9-L2ozsZWSlZpPU,41287
|
198
|
-
ultralytics/nn/tasks.py,sha256=
|
198
|
+
ultralytics/nn/tasks.py,sha256=u3xrh78tzI_K_uk0b7gNaDZZQYiwIz7kRrsZGb2SGdM,72436
|
199
199
|
ultralytics/nn/text_model.py,sha256=m4jDB5bzOLOS8XNmFi9oQk-skzRHiIpJy4K-_SIARR0,13498
|
200
200
|
ultralytics/nn/modules/__init__.py,sha256=2nY0X69Z5DD5SWt6v3CUTZa5gXSzC9TQr3VTVqhyGho,3158
|
201
201
|
ultralytics/nn/modules/activation.py,sha256=75JcIMH2Cu9GTC2Uf55r_5YLpxcrXQDaVoeGQ0hlUAU,2233
|
@@ -246,7 +246,7 @@ ultralytics/utils/export.py,sha256=ZmxiY5Y2MuL4iBFsLr8ykbUsnvT01DCs0Kg1w3_Ikac,9
|
|
246
246
|
ultralytics/utils/files.py,sha256=ZCbLGleiF0f-PqYfaxMFAWop88w7U1hpreHXl8b2ko0,8238
|
247
247
|
ultralytics/utils/instance.py,sha256=vhqaZRGT_4K9Q3oQH5KNNK4ISOzxlf1_JjauwhuFhu0,18408
|
248
248
|
ultralytics/utils/loss.py,sha256=fbOWc3Iu0QOJiWbi-mXWA9-1otTYlehtmUsI7os7ydM,39799
|
249
|
-
ultralytics/utils/metrics.py,sha256=
|
249
|
+
ultralytics/utils/metrics.py,sha256=aHVagoemzNLPiQwpb1BxoNfKOebyYUJj679EKN8RBJc,63888
|
250
250
|
ultralytics/utils/ops.py,sha256=Yjm397sirPt9wNlgHU2SeVEApeEeYX1msSg5cTBGN8g,34381
|
251
251
|
ultralytics/utils/patches.py,sha256=GI7NXCJ5H22FGp3sIvj5rrGfwdYNRWlxFcW-Jhjgius,5181
|
252
252
|
ultralytics/utils/plotting.py,sha256=QMwedj19XNHus5NbUY3cQI1PGDgriPhHOzGirBsxdK8,48277
|
@@ -265,9 +265,9 @@ ultralytics/utils/callbacks/neptune.py,sha256=j8pecmlcsM8FGzLKWoBw5xUsi5t8E5HuxY
|
|
265
265
|
ultralytics/utils/callbacks/raytune.py,sha256=S6Bq16oQDQ8BQgnZzA0zJHGN_BBr8iAM_WtGoLiEcwg,1283
|
266
266
|
ultralytics/utils/callbacks/tensorboard.py,sha256=MDPBW7aDes-66OE6YqKXXvqA_EocjzEMHWGM-8z9vUQ,5281
|
267
267
|
ultralytics/utils/callbacks/wb.py,sha256=Tm_-aRr2CN32MJkY9tylpMBJkb007-MSRNSQ7rDJ5QU,7521
|
268
|
-
ultralytics-8.3.
|
269
|
-
ultralytics-8.3.
|
270
|
-
ultralytics-8.3.
|
271
|
-
ultralytics-8.3.
|
272
|
-
ultralytics-8.3.
|
273
|
-
ultralytics-8.3.
|
268
|
+
ultralytics-8.3.149.dist-info/licenses/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
269
|
+
ultralytics-8.3.149.dist-info/METADATA,sha256=_RFfbcSWF2fcecTdWjY0AMfiglJJG3vuwVimEx6M9-Q,37200
|
270
|
+
ultralytics-8.3.149.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
271
|
+
ultralytics-8.3.149.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
|
272
|
+
ultralytics-8.3.149.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
|
273
|
+
ultralytics-8.3.149.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|