ultralytics 8.3.148__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/loaders.py +1 -2
- ultralytics/engine/exporter.py +1 -1
- ultralytics/engine/predictor.py +17 -10
- ultralytics/utils/metrics.py +19 -3
- {ultralytics-8.3.148.dist-info → ultralytics-8.3.149.dist-info}/METADATA +1 -1
- {ultralytics-8.3.148.dist-info → ultralytics-8.3.149.dist-info}/RECORD +11 -11
- {ultralytics-8.3.148.dist-info → ultralytics-8.3.149.dist-info}/WHEEL +0 -0
- {ultralytics-8.3.148.dist-info → ultralytics-8.3.149.dist-info}/entry_points.txt +0 -0
- {ultralytics-8.3.148.dist-info → ultralytics-8.3.149.dist-info}/licenses/LICENSE +0 -0
- {ultralytics-8.3.148.dist-info → ultralytics-8.3.149.dist-info}/top_level.txt +0 -0
ultralytics/__init__.py
CHANGED
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
@@ -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/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
|
@@ -110,7 +110,7 @@ ultralytics/data/base.py,sha256=mRcuehK1thNuuzQGL6D1AaZkod71oHRdYTod_zdQZQg,1968
|
|
110
110
|
ultralytics/data/build.py,sha256=Djz6stD1FXmFhnoUJp-MKp7geu-k3xhnvt9kfXFKGhI,11020
|
111
111
|
ultralytics/data/converter.py,sha256=oKW8ODtvFOKBx9Un8n87xUUm3b5GStU4ViIBH5UDylM,27200
|
112
112
|
ultralytics/data/dataset.py,sha256=bVi1yTfQKJGKItMDTYzIE6MIEPpWqzXnUqra5AXmV18,35443
|
113
|
-
ultralytics/data/loaders.py,sha256=
|
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
|
@@ -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
|