ultralytics 8.3.20__py3-none-any.whl → 8.3.21__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/engine/exporter.py +21 -2
- ultralytics/utils/callbacks/comet.py +33 -10
- {ultralytics-8.3.20.dist-info → ultralytics-8.3.21.dist-info}/METADATA +2 -2
- {ultralytics-8.3.20.dist-info → ultralytics-8.3.21.dist-info}/RECORD +9 -9
- {ultralytics-8.3.20.dist-info → ultralytics-8.3.21.dist-info}/LICENSE +0 -0
- {ultralytics-8.3.20.dist-info → ultralytics-8.3.21.dist-info}/WHEEL +0 -0
- {ultralytics-8.3.20.dist-info → ultralytics-8.3.21.dist-info}/entry_points.txt +0 -0
- {ultralytics-8.3.20.dist-info → ultralytics-8.3.21.dist-info}/top_level.txt +0 -0
ultralytics/__init__.py
CHANGED
ultralytics/engine/exporter.py
CHANGED
@@ -194,6 +194,11 @@ class Exporter:
|
|
194
194
|
is_tf_format = any((saved_model, pb, tflite, edgetpu, tfjs))
|
195
195
|
|
196
196
|
# Device
|
197
|
+
dla = None
|
198
|
+
if fmt == "engine" and "dla" in self.args.device:
|
199
|
+
dla = self.args.device.split(":")[-1]
|
200
|
+
assert dla in {"0", "1"}, f"Expected self.args.device='dla:0' or 'dla:1, but got {self.args.device}."
|
201
|
+
self.args.device = "0"
|
197
202
|
if fmt == "engine" and self.args.device is None:
|
198
203
|
LOGGER.warning("WARNING ⚠️ TensorRT requires GPU export, automatically assigning device=0")
|
199
204
|
self.args.device = "0"
|
@@ -309,7 +314,7 @@ class Exporter:
|
|
309
314
|
if jit or ncnn: # TorchScript
|
310
315
|
f[0], _ = self.export_torchscript()
|
311
316
|
if engine: # TensorRT required before ONNX
|
312
|
-
f[1], _ = self.export_engine()
|
317
|
+
f[1], _ = self.export_engine(dla=dla)
|
313
318
|
if onnx: # ONNX
|
314
319
|
f[2], _ = self.export_onnx()
|
315
320
|
if xml: # OpenVINO
|
@@ -682,7 +687,7 @@ class Exporter:
|
|
682
687
|
return f, ct_model
|
683
688
|
|
684
689
|
@try_export
|
685
|
-
def export_engine(self, prefix=colorstr("TensorRT:")):
|
690
|
+
def export_engine(self, dla=None, prefix=colorstr("TensorRT:")):
|
686
691
|
"""YOLO TensorRT export https://developer.nvidia.com/tensorrt."""
|
687
692
|
assert self.im.device.type != "cpu", "export running on CPU but must be on GPU, i.e. use 'device=0'"
|
688
693
|
f_onnx, _ = self.export_onnx() # run before TRT import https://github.com/ultralytics/ultralytics/issues/7016
|
@@ -717,6 +722,20 @@ class Exporter:
|
|
717
722
|
network = builder.create_network(flag)
|
718
723
|
half = builder.platform_has_fast_fp16 and self.args.half
|
719
724
|
int8 = builder.platform_has_fast_int8 and self.args.int8
|
725
|
+
|
726
|
+
# Optionally switch to DLA if enabled
|
727
|
+
if dla is not None:
|
728
|
+
if not IS_JETSON:
|
729
|
+
raise ValueError("DLA is only available on NVIDIA Jetson devices")
|
730
|
+
LOGGER.info(f"{prefix} enabling DLA on core {dla}...")
|
731
|
+
if not self.args.half and not self.args.int8:
|
732
|
+
raise ValueError(
|
733
|
+
"DLA requires either 'half=True' (FP16) or 'int8=True' (INT8) to be enabled. Please enable one of them and try again."
|
734
|
+
)
|
735
|
+
config.default_device_type = trt.DeviceType.DLA
|
736
|
+
config.DLA_core = int(dla)
|
737
|
+
config.set_flag(trt.BuilderFlag.GPU_FALLBACK)
|
738
|
+
|
720
739
|
# Read ONNX file
|
721
740
|
parser = trt.OnnxParser(network, logger)
|
722
741
|
if not parser.parse_from_file(f_onnx):
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
2
2
|
|
3
3
|
from ultralytics.utils import LOGGER, RANK, SETTINGS, TESTS_RUNNING, ops
|
4
|
+
from ultralytics.utils.metrics import ClassifyMetrics, DetMetrics, OBBMetrics, PoseMetrics, SegmentMetrics
|
4
5
|
|
5
6
|
try:
|
6
7
|
assert not TESTS_RUNNING # do not log pytest
|
@@ -16,8 +17,11 @@ try:
|
|
16
17
|
COMET_SUPPORTED_TASKS = ["detect"]
|
17
18
|
|
18
19
|
# Names of plots created by Ultralytics that are logged to Comet
|
19
|
-
|
20
|
+
CONFUSION_MATRIX_PLOT_NAMES = "confusion_matrix", "confusion_matrix_normalized"
|
21
|
+
EVALUATION_PLOT_NAMES = "F1_curve", "P_curve", "R_curve", "PR_curve"
|
20
22
|
LABEL_PLOT_NAMES = "labels", "labels_correlogram"
|
23
|
+
SEGMENT_METRICS_PLOT_PREFIX = "Box", "Mask"
|
24
|
+
POSE_METRICS_PLOT_PREFIX = "Box", "Pose"
|
21
25
|
|
22
26
|
_comet_image_prediction_count = 0
|
23
27
|
|
@@ -86,7 +90,7 @@ def _create_experiment(args):
|
|
86
90
|
"max_image_predictions": _get_max_image_predictions_to_log(),
|
87
91
|
}
|
88
92
|
)
|
89
|
-
experiment.log_other("Created from", "
|
93
|
+
experiment.log_other("Created from", "ultralytics")
|
90
94
|
|
91
95
|
except Exception as e:
|
92
96
|
LOGGER.warning(f"WARNING ⚠️ Comet installed but not initialized correctly, not logging this run. {e}")
|
@@ -274,11 +278,31 @@ def _log_image_predictions(experiment, validator, curr_step):
|
|
274
278
|
|
275
279
|
def _log_plots(experiment, trainer):
|
276
280
|
"""Logs evaluation plots and label plots for the experiment."""
|
277
|
-
plot_filenames =
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
281
|
+
plot_filenames = None
|
282
|
+
if isinstance(trainer.validator.metrics, SegmentMetrics) and trainer.validator.metrics.task == "segment":
|
283
|
+
plot_filenames = [
|
284
|
+
trainer.save_dir / f"{prefix}{plots}.png"
|
285
|
+
for plots in EVALUATION_PLOT_NAMES
|
286
|
+
for prefix in SEGMENT_METRICS_PLOT_PREFIX
|
287
|
+
]
|
288
|
+
elif isinstance(trainer.validator.metrics, PoseMetrics):
|
289
|
+
plot_filenames = [
|
290
|
+
trainer.save_dir / f"{prefix}{plots}.png"
|
291
|
+
for plots in EVALUATION_PLOT_NAMES
|
292
|
+
for prefix in POSE_METRICS_PLOT_PREFIX
|
293
|
+
]
|
294
|
+
elif isinstance(trainer.validator.metrics, DetMetrics) or isinstance(trainer.validator.metrics, OBBMetrics):
|
295
|
+
plot_filenames = [trainer.save_dir / f"{plots}.png" for plots in EVALUATION_PLOT_NAMES]
|
296
|
+
|
297
|
+
if plot_filenames is not None:
|
298
|
+
_log_images(experiment, plot_filenames, None)
|
299
|
+
|
300
|
+
confusion_matrix_filenames = [trainer.save_dir / f"{plots}.png" for plots in CONFUSION_MATRIX_PLOT_NAMES]
|
301
|
+
_log_images(experiment, confusion_matrix_filenames, None)
|
302
|
+
|
303
|
+
if not isinstance(trainer.validator.metrics, ClassifyMetrics):
|
304
|
+
label_plot_filenames = [trainer.save_dir / f"{labels}.jpg" for labels in LABEL_PLOT_NAMES]
|
305
|
+
_log_images(experiment, label_plot_filenames, None)
|
282
306
|
|
283
307
|
|
284
308
|
def _log_model(experiment, trainer):
|
@@ -307,9 +331,6 @@ def on_train_epoch_end(trainer):
|
|
307
331
|
|
308
332
|
experiment.log_metrics(trainer.label_loss_items(trainer.tloss, prefix="train"), step=curr_step, epoch=curr_epoch)
|
309
333
|
|
310
|
-
if curr_epoch == 1:
|
311
|
-
_log_images(experiment, trainer.save_dir.glob("train_batch*.jpg"), curr_step)
|
312
|
-
|
313
334
|
|
314
335
|
def on_fit_epoch_end(trainer):
|
315
336
|
"""Logs model assets at the end of each epoch."""
|
@@ -356,6 +377,8 @@ def on_train_end(trainer):
|
|
356
377
|
|
357
378
|
_log_confusion_matrix(experiment, trainer, curr_step, curr_epoch)
|
358
379
|
_log_image_predictions(experiment, trainer.validator, curr_step)
|
380
|
+
_log_images(experiment, trainer.save_dir.glob("train_batch*.jpg"), curr_step)
|
381
|
+
_log_images(experiment, trainer.save_dir.glob("val_batch*.jpg"), curr_step)
|
359
382
|
experiment.end()
|
360
383
|
|
361
384
|
global _comet_image_prediction_count
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ultralytics
|
3
|
-
Version: 8.3.
|
3
|
+
Version: 8.3.21
|
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>
|
@@ -113,7 +113,7 @@ We hope that the resources here will help you get the most out of YOLO. Please b
|
|
113
113
|
|
114
114
|
To request an Enterprise License please complete the form at [Ultralytics Licensing](https://www.ultralytics.com/license).
|
115
115
|
|
116
|
-
<img width="100%" src="https://
|
116
|
+
<img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/refs/heads/main/yolo/performance-comparison.png" alt="YOLO11 performance plots"></a>
|
117
117
|
|
118
118
|
<div align="center">
|
119
119
|
<a href="https://github.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-github.png" width="2%" alt="Ultralytics GitHub"></a>
|
@@ -7,7 +7,7 @@ tests/test_exports.py,sha256=fpTKEVBUGLF3WiZPNKRs-IEcIY4cfxgvgKjUNfodjww,8042
|
|
7
7
|
tests/test_integrations.py,sha256=f5-QCUk1SU_-qn4mBCZwS3GN3tXEBIIXo4z2EhExbHw,6126
|
8
8
|
tests/test_python.py,sha256=I1RRdCwLdrc3jX06huVxct8HX8ccQOmQgVpuEflRl0U,23560
|
9
9
|
tests/test_solutions.py,sha256=sPYhy2d814mIVvojQeVxeZPu0IVy01_Y8zuMcu_9GF0,3790
|
10
|
-
ultralytics/__init__.py,sha256=
|
10
|
+
ultralytics/__init__.py,sha256=sjLDHMeQ0AywBLO6JeI5yszHWHMol049_8XZUPS1DN4,681
|
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=hj7JH0TgnF9OlKi4uJBUu-KeQh4PFnSQCTiD_h_u_Sg,32399
|
@@ -99,7 +99,7 @@ ultralytics/data/loaders.py,sha256=Fr70Q9p9t7buLW_8R2_lI_nyCMG033gWSxvwy1M-a-U,2
|
|
99
99
|
ultralytics/data/split_dota.py,sha256=eFafJ7Vg52wj6KDCHFJAf1tKzyPD5YaPB8kM4VX5Aeg,10688
|
100
100
|
ultralytics/data/utils.py,sha256=bmWEIrdogj4kssZQSJdSbIF8QsJU00lo-EY-Mgcqv4M,31073
|
101
101
|
ultralytics/engine/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
102
|
-
ultralytics/engine/exporter.py,sha256=
|
102
|
+
ultralytics/engine/exporter.py,sha256=n2QVX7HgiQoWFbyq1O0uzoM9RXO9cD2TCA9fVW8Kv50,58617
|
103
103
|
ultralytics/engine/model.py,sha256=pvL1uf-wwdWL8Iph7VEAYn1-z7wEHzVug21V_0_gO6M,51456
|
104
104
|
ultralytics/engine/predictor.py,sha256=keTelEeo23Dcbs-XvmRWAPIs4pbCNDtsMBz88WM1eK8,17534
|
105
105
|
ultralytics/engine/results.py,sha256=BxanBI8PhBCfs-9cSy-GS6naScuiD3hdvUAJWPW2mS0,75043
|
@@ -219,7 +219,7 @@ ultralytics/utils/tuner.py,sha256=mJdgvuE2StoFS13mEdsTbsxQgSZA4fSdSCgoyh8PvNw,62
|
|
219
219
|
ultralytics/utils/callbacks/__init__.py,sha256=YrWqC3BVVaTLob4iCPR6I36mUxIUOpPJW7B_LjT78Qw,214
|
220
220
|
ultralytics/utils/callbacks/base.py,sha256=PHjQ6RITwC2dylCQTB0bdPgAsHjxVeuDb5N1NPTbHGc,5775
|
221
221
|
ultralytics/utils/callbacks/clearml.py,sha256=qbLbqzMVWAnjqg5YUM-Ue6CmGueFCvqKpHFKlw-MyVc,5933
|
222
|
-
ultralytics/utils/callbacks/comet.py,sha256=
|
222
|
+
ultralytics/utils/callbacks/comet.py,sha256=XGMgBAfqqlGeJSF4OO_QUSaydNMY8BgLytBVeeISCl8,15057
|
223
223
|
ultralytics/utils/callbacks/dvc.py,sha256=WIClMsuvhiiyrwRv5BsZLxjsxYNJ3Y8Vq7zN0Bthtro,5045
|
224
224
|
ultralytics/utils/callbacks/hub.py,sha256=EPewsLigFQc9ucTX2exKSlKBiaBNhYYyGC_nR2ragJo,3997
|
225
225
|
ultralytics/utils/callbacks/mlflow.py,sha256=mkl_rK0Gy02cXnQUYmzmLE5W97fMgfEb7IlgOAdnjHg,5396
|
@@ -227,9 +227,9 @@ ultralytics/utils/callbacks/neptune.py,sha256=IbGQfEltamUKXJt93uSLQFn8c2rYh3DMTg
|
|
227
227
|
ultralytics/utils/callbacks/raytune.py,sha256=ODVYzy-CoM4Uge0zjkh3Hnh9nF2M0vhDrSenXnvcizw,705
|
228
228
|
ultralytics/utils/callbacks/tensorboard.py,sha256=SHlE58Fb-sg-uZKtgy-ybIO3SAIfK55aj8kTYGA0Cyg,4167
|
229
229
|
ultralytics/utils/callbacks/wb.py,sha256=oX3JarCJGhzvW556XiEXQNaZblAaK_UETAt3kzkY61w,6869
|
230
|
-
ultralytics-8.3.
|
231
|
-
ultralytics-8.3.
|
232
|
-
ultralytics-8.3.
|
233
|
-
ultralytics-8.3.
|
234
|
-
ultralytics-8.3.
|
235
|
-
ultralytics-8.3.
|
230
|
+
ultralytics-8.3.21.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
231
|
+
ultralytics-8.3.21.dist-info/METADATA,sha256=Csag1L6eFb3o8xQTQpG2CH5DUV9N7zM33z_aaNLHwg4,34839
|
232
|
+
ultralytics-8.3.21.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
233
|
+
ultralytics-8.3.21.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
|
234
|
+
ultralytics-8.3.21.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
|
235
|
+
ultralytics-8.3.21.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|