ultralytics 8.3.69__py3-none-any.whl → 8.3.70__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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
2
2
 
3
- __version__ = "8.3.69"
3
+ __version__ = "8.3.70"
4
4
 
5
5
  import os
6
6
 
@@ -661,6 +661,7 @@ class Model(nn.Module):
661
661
  - int8 (bool): Whether to use int8 precision mode.
662
662
  - device (str): Device to run the benchmark on (e.g., 'cpu', 'cuda').
663
663
  - verbose (bool): Whether to print detailed benchmark information.
664
+ - format (str): Export format name for specific benchmarking
664
665
 
665
666
  Returns:
666
667
  (Dict): A dictionary containing the results of the benchmarking process, including metrics for
@@ -686,7 +687,8 @@ class Model(nn.Module):
686
687
  half=args["half"],
687
688
  int8=args["int8"],
688
689
  device=args["device"],
689
- verbose=kwargs.get("verbose"),
690
+ verbose=kwargs.get("verbose", False),
691
+ format=kwargs.get("format", ""),
690
692
  )
691
693
 
692
694
  def export(
@@ -293,6 +293,12 @@ class AutoBackend(nn.Module):
293
293
  except UnicodeDecodeError:
294
294
  f.seek(0) # engine file may lack embedded Ultralytics metadata
295
295
  model = runtime.deserialize_cuda_engine(f.read()) # read engine
296
+ if "dla" in str(device.type):
297
+ dla_core = int(device.type.split(":")[1])
298
+ assert dla_core in {0, 1}, (
299
+ "Expected device type for inference in DLA is 'dla:0' or 'dla:1', but received '{device.type}'"
300
+ )
301
+ runtime.DLA_core = dla_core
296
302
 
297
303
  # Model context
298
304
  try:
@@ -57,6 +57,7 @@ def benchmark(
57
57
  device="cpu",
58
58
  verbose=False,
59
59
  eps=1e-3,
60
+ format="",
60
61
  ):
61
62
  """
62
63
  Benchmark a YOLO model across different formats for speed and accuracy.
@@ -70,6 +71,7 @@ def benchmark(
70
71
  device (str): Device to run the benchmark on, either 'cpu' or 'cuda'.
71
72
  verbose (bool | float): If True or a float, assert benchmarks pass with given metric.
72
73
  eps (float): Epsilon value for divide by zero prevention.
74
+ format (str): Export format for benchmarking. If not supplied all formats are benchmarked.
73
75
 
74
76
  Returns:
75
77
  (pandas.DataFrame): A pandas DataFrame with benchmark results for each format, including file size, metric,
@@ -94,9 +96,17 @@ def benchmark(
94
96
 
95
97
  y = []
96
98
  t0 = time.time()
99
+
100
+ format_arg = format.lower()
101
+ if format_arg:
102
+ formats = frozenset(export_formats()["Argument"])
103
+ assert format in formats, f"Expected format to be one of {formats}, but got '{format_arg}'."
97
104
  for i, (name, format, suffix, cpu, gpu, _) in enumerate(zip(*export_formats().values())):
98
105
  emoji, filename = "❌", None # export defaults
99
106
  try:
107
+ if format_arg and format_arg != format:
108
+ continue
109
+
100
110
  # Checks
101
111
  if i == 7: # TF GraphDef
102
112
  assert model.task != "obb", "TensorFlow GraphDef not supported for OBB task"
@@ -155,10 +165,10 @@ def benchmark(
155
165
 
156
166
  # Validate
157
167
  data = data or TASK2DATA[model.task] # task to dataset, i.e. coco8.yaml for task=detect
158
- key = TASK2METRIC[model.task] # task to metric, i.e. metrics/mAP50-95(B) for task=detect
159
168
  results = exported_model.val(
160
169
  data=data, batch=1, imgsz=imgsz, plots=False, device=device, half=half, int8=int8, verbose=False
161
170
  )
171
+ key = TASK2METRIC[model.task] # task to metric, i.e. metrics/mAP50-95(B) for task=detect
162
172
  metric, speed = results.results_dict[key], results.speed["inference"]
163
173
  fps = round(1000 / (speed + eps), 2) # frames per second
164
174
  y.append([name, "✅", round(file_size(filename), 1), round(metric, 4), round(speed, 2), fps])
@@ -433,8 +433,8 @@ def check_torchvision():
433
433
  The compatibility table is a dictionary where the keys are PyTorch versions and the values are lists of compatible
434
434
  Torchvision versions.
435
435
  """
436
- # Compatibility table
437
436
  compatibility_table = {
437
+ "2.6": ["0.21"],
438
438
  "2.5": ["0.20"],
439
439
  "2.4": ["0.19"],
440
440
  "2.3": ["0.18"],
@@ -445,7 +445,7 @@ def check_torchvision():
445
445
  "1.12": ["0.13"],
446
446
  }
447
447
 
448
- # Extract only the major and minor versions
448
+ # Check major and minor versions
449
449
  v_torch = ".".join(torch.__version__.split("+")[0].split(".")[:2])
450
450
  if v_torch in compatibility_table:
451
451
  compatible_versions = compatibility_table[v_torch]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ultralytics
3
- Version: 8.3.69
3
+ Version: 8.3.70
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>
@@ -32,8 +32,7 @@ Classifier: Operating System :: Microsoft :: Windows
32
32
  Requires-Python: >=3.8
33
33
  Description-Content-Type: text/markdown
34
34
  License-File: LICENSE
35
- Requires-Dist: numpy>=1.23.0
36
- Requires-Dist: numpy<2.0.0; sys_platform == "darwin"
35
+ Requires-Dist: numpy<=2.1.1,>=1.23.0
37
36
  Requires-Dist: matplotlib>=3.3.0
38
37
  Requires-Dist: opencv-python>=4.6.0
39
38
  Requires-Dist: pillow>=7.1.2
@@ -58,7 +57,7 @@ Requires-Dist: mkdocs>=1.6.0; extra == "dev"
58
57
  Requires-Dist: mkdocs-material>=9.5.9; extra == "dev"
59
58
  Requires-Dist: mkdocstrings[python]; extra == "dev"
60
59
  Requires-Dist: mkdocs-redirects; extra == "dev"
61
- Requires-Dist: mkdocs-ultralytics-plugin>=0.1.8; extra == "dev"
60
+ Requires-Dist: mkdocs-ultralytics-plugin>=0.1.16; extra == "dev"
62
61
  Requires-Dist: mkdocs-macros-plugin>=1.0.5; extra == "dev"
63
62
  Provides-Extra: export
64
63
  Requires-Dist: onnx>=1.12.0; extra == "export"
@@ -7,7 +7,7 @@ tests/test_exports.py,sha256=T_z_NUS9URQXv83k5XNLHTuksJ8srtzbZnWuiiQWM98,9260
7
7
  tests/test_integrations.py,sha256=p3DMnnPMKsV0Qm82JVJUIY1UZ67xRgF9E8AaL76TEHE,6154
8
8
  tests/test_python.py,sha256=tW-EFJC2rjl_DvAa8khXGWYdypseQjrLjGHhe2p9r9A,23238
9
9
  tests/test_solutions.py,sha256=aY0G3vNzXGCENG9FD76MfUp7jgzeESPsUvbvQYBUvH0,4205
10
- ultralytics/__init__.py,sha256=AmBs8gI8Wd8RZmYCZilP06XA8mpUvbFqUDMWP5PpKbo,709
10
+ ultralytics/__init__.py,sha256=j3YQErIHDNSCpzI0cVKuv3P5WDskw3yu1p1_ZVpOZFY,709
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=qP44HnFP4QcC5FQz29A-EGTuwdtxXAzPvw_IvCVmiqA,39771
@@ -103,7 +103,7 @@ ultralytics/data/split_dota.py,sha256=YI-i2MqdiBt06W67TJnBXQHJrqTnkJDJ3zzoL0UZVr
103
103
  ultralytics/data/utils.py,sha256=K8xyA1xHLpaeluUbqOl5fy6AWZ6nDciCBZJofjxzOuw,33841
104
104
  ultralytics/engine/__init__.py,sha256=lm6MckFYCPTbqIoX7w0s_daxdjNeBeKW6DXppv1-QUM,70
105
105
  ultralytics/engine/exporter.py,sha256=aXUX8GZUw1CBaXYSI7OFwx1tsnl6VkgQQXb_iKi-cs8,76632
106
- ultralytics/engine/model.py,sha256=IHeaCwXlbxs6f2gVF5hEQVUiY-3F9Oz1wJNSTPZ-tZ0,53110
106
+ ultralytics/engine/model.py,sha256=OmYpb5YiCM_FPsqezUybWfUUD5jgWDvOu0CPg0hxj2Q,53239
107
107
  ultralytics/engine/predictor.py,sha256=jiYDAjupOlRUpPvw9tu7or9PjXtLm-YCRiawANtWxj0,17881
108
108
  ultralytics/engine/results.py,sha256=3jag9GQcJ2a_No76tEOWvT8gqm4X-SWAxoVc0NYenbI,78512
109
109
  ultralytics/engine/trainer.py,sha256=ZGAc6C1_LUBHDdZlr6wT6sbMtDzWa5rr7M8QVlXpBLs,37362
@@ -172,7 +172,7 @@ ultralytics/models/yolo/world/__init__.py,sha256=nlh8I6t8hMGz_vZg8QSlsUW1R-2eKvn
172
172
  ultralytics/models/yolo/world/train.py,sha256=6PVmQ0G-22OOPPwP_rqSobe2LM6e2b_lC7lJCdW3UIk,3714
173
173
  ultralytics/models/yolo/world/train_world.py,sha256=sCtg4Hnq9Y7amYjlQsdvTHXH8cKSooipvcXu_1Iyb2k,4885
174
174
  ultralytics/nn/__init__.py,sha256=rjociYD9lo_K-d-1s6TbdWklPLjTcEHk7OIlRDJstIE,615
175
- ultralytics/nn/autobackend.py,sha256=42q841CpDzzZSx1U4CkagTv-MywqwXaQWCOych3jgAI,37227
175
+ ultralytics/nn/autobackend.py,sha256=gYZ0BjyYuPdxVfshjcrjFX9F5Rvi_5J9HijEEGGlDmg,37574
176
176
  ultralytics/nn/tasks.py,sha256=Qe9EZ7NBDT5zOFAqJSl5XhYWnMDByuQL80r6pP0TuDM,48892
177
177
  ultralytics/nn/modules/__init__.py,sha256=02dPoAMtpPNQdHXHmvJeWZvJ_WG6eqwH8atLdFWgcuY,2713
178
178
  ultralytics/nn/modules/activation.py,sha256=oRkhMdqlNpIxQb35pTSUeHV-h0VyLl96GOqvIZ4OvT8,923
@@ -206,8 +206,8 @@ ultralytics/trackers/utils/kalman_filter.py,sha256=OBvemZXptgn9v1sgBLvFomCqOWwjI
206
206
  ultralytics/trackers/utils/matching.py,sha256=64PKHGoETwXhuZ9udE217hbjJHygLOPaYA66J2qMSno,7130
207
207
  ultralytics/utils/__init__.py,sha256=Ahn7Vn60HIquaBZwLWfWH4bKnm0JcpJXYxnOnY-RH-s,50010
208
208
  ultralytics/utils/autobatch.py,sha256=zc81HlAMArPASEbExty0E_zpITF8PVwin7w-xBFFZ5w,5048
209
- ultralytics/utils/benchmarks.py,sha256=MDvH3sPR6KJnjApdNsMz9t1y7KHZndyvVRoKcMXXIa4,26315
210
- ultralytics/utils/checks.py,sha256=P543iMxEbXi0WWGrY67GaA7jIsas63K4uCSZpqmVx8M,31017
209
+ ultralytics/utils/benchmarks.py,sha256=Jn29MQ3A3CjGjY7IQKo0odY7HGmyaIm7IwckMRK345w,26718
210
+ ultralytics/utils/checks.py,sha256=uCSkC3HCjynrfyQQ3uaeX-60USRjALm2NpxtS7rWwKc,31005
211
211
  ultralytics/utils/dist.py,sha256=fuiJQEnyyL-SighlI3hUlZPaaSreUl4Q39snF6OhQtI,2386
212
212
  ultralytics/utils/downloads.py,sha256=aUESyJOE2d7mJwbGECHWLR3RF8HVQPSwNH0cfmLGgdI,21999
213
213
  ultralytics/utils/errors.py,sha256=sXKDEd8ws3L-yIfG_-P_h86axbm37sJNha7kFBJbQMQ,844
@@ -233,9 +233,9 @@ ultralytics/utils/callbacks/neptune.py,sha256=waZ_bRu0-qBKujTLuqonC2gx2DkgBuVnfq
233
233
  ultralytics/utils/callbacks/raytune.py,sha256=TbuZlDb721aIkh-nMozZcP2g_ttUh2cG5LUaXmept6g,728
234
234
  ultralytics/utils/callbacks/tensorboard.py,sha256=JHOEVlNQ5dYJPd4Z-EvqbXowuK5uA0p8wPgyyaIUQs0,4194
235
235
  ultralytics/utils/callbacks/wb.py,sha256=ayhT2y62AcSOacnawshATU0rWrlSFQ77mrGgBdRl3W4,7086
236
- ultralytics-8.3.69.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
237
- ultralytics-8.3.69.dist-info/METADATA,sha256=2c2ngPmnx2wTvDCASBt4b8x7XGnVX-C5XCjFPJjDFEo,35202
238
- ultralytics-8.3.69.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
239
- ultralytics-8.3.69.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
240
- ultralytics-8.3.69.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
241
- ultralytics-8.3.69.dist-info/RECORD,,
236
+ ultralytics-8.3.70.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
237
+ ultralytics-8.3.70.dist-info/METADATA,sha256=8zLROnbBCxv6CrH0DeczplZZ_AKSFebeiOSNTwOp1kU,35158
238
+ ultralytics-8.3.70.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
239
+ ultralytics-8.3.70.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
240
+ ultralytics-8.3.70.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
241
+ ultralytics-8.3.70.dist-info/RECORD,,