dgenerate-ultralytics-headless 8.3.214__py3-none-any.whl → 8.4.7__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.
Files changed (249) hide show
  1. {dgenerate_ultralytics_headless-8.3.214.dist-info → dgenerate_ultralytics_headless-8.4.7.dist-info}/METADATA +64 -74
  2. dgenerate_ultralytics_headless-8.4.7.dist-info/RECORD +311 -0
  3. {dgenerate_ultralytics_headless-8.3.214.dist-info → dgenerate_ultralytics_headless-8.4.7.dist-info}/WHEEL +1 -1
  4. tests/__init__.py +7 -9
  5. tests/conftest.py +8 -15
  6. tests/test_cli.py +1 -1
  7. tests/test_cuda.py +13 -10
  8. tests/test_engine.py +9 -9
  9. tests/test_exports.py +65 -13
  10. tests/test_integrations.py +13 -13
  11. tests/test_python.py +125 -69
  12. tests/test_solutions.py +161 -152
  13. ultralytics/__init__.py +1 -1
  14. ultralytics/cfg/__init__.py +86 -92
  15. ultralytics/cfg/datasets/Argoverse.yaml +7 -6
  16. ultralytics/cfg/datasets/DOTAv1.5.yaml +1 -1
  17. ultralytics/cfg/datasets/DOTAv1.yaml +1 -1
  18. ultralytics/cfg/datasets/ImageNet.yaml +1 -1
  19. ultralytics/cfg/datasets/TT100K.yaml +346 -0
  20. ultralytics/cfg/datasets/VOC.yaml +15 -16
  21. ultralytics/cfg/datasets/african-wildlife.yaml +1 -1
  22. ultralytics/cfg/datasets/coco-pose.yaml +21 -0
  23. ultralytics/cfg/datasets/coco12-formats.yaml +101 -0
  24. ultralytics/cfg/datasets/coco128-seg.yaml +1 -1
  25. ultralytics/cfg/datasets/coco8-pose.yaml +21 -0
  26. ultralytics/cfg/datasets/dog-pose.yaml +28 -0
  27. ultralytics/cfg/datasets/dota8-multispectral.yaml +1 -1
  28. ultralytics/cfg/datasets/dota8.yaml +2 -2
  29. ultralytics/cfg/datasets/hand-keypoints.yaml +26 -2
  30. ultralytics/cfg/datasets/kitti.yaml +27 -0
  31. ultralytics/cfg/datasets/lvis.yaml +5 -5
  32. ultralytics/cfg/datasets/open-images-v7.yaml +1 -1
  33. ultralytics/cfg/datasets/tiger-pose.yaml +16 -0
  34. ultralytics/cfg/datasets/xView.yaml +16 -16
  35. ultralytics/cfg/default.yaml +4 -2
  36. ultralytics/cfg/models/11/yolo11-pose.yaml +1 -1
  37. ultralytics/cfg/models/11/yoloe-11-seg.yaml +2 -2
  38. ultralytics/cfg/models/11/yoloe-11.yaml +2 -2
  39. ultralytics/cfg/models/26/yolo26-cls.yaml +33 -0
  40. ultralytics/cfg/models/26/yolo26-obb.yaml +52 -0
  41. ultralytics/cfg/models/26/yolo26-p2.yaml +60 -0
  42. ultralytics/cfg/models/26/yolo26-p6.yaml +62 -0
  43. ultralytics/cfg/models/26/yolo26-pose.yaml +53 -0
  44. ultralytics/cfg/models/26/yolo26-seg.yaml +52 -0
  45. ultralytics/cfg/models/26/yolo26.yaml +52 -0
  46. ultralytics/cfg/models/26/yoloe-26-seg.yaml +53 -0
  47. ultralytics/cfg/models/26/yoloe-26.yaml +53 -0
  48. ultralytics/cfg/models/rt-detr/rtdetr-l.yaml +1 -1
  49. ultralytics/cfg/models/rt-detr/rtdetr-resnet101.yaml +1 -1
  50. ultralytics/cfg/models/rt-detr/rtdetr-resnet50.yaml +1 -1
  51. ultralytics/cfg/models/rt-detr/rtdetr-x.yaml +1 -1
  52. ultralytics/cfg/models/v10/yolov10b.yaml +2 -2
  53. ultralytics/cfg/models/v10/yolov10l.yaml +2 -2
  54. ultralytics/cfg/models/v10/yolov10m.yaml +2 -2
  55. ultralytics/cfg/models/v10/yolov10n.yaml +2 -2
  56. ultralytics/cfg/models/v10/yolov10s.yaml +2 -2
  57. ultralytics/cfg/models/v10/yolov10x.yaml +2 -2
  58. ultralytics/cfg/models/v3/yolov3-tiny.yaml +1 -1
  59. ultralytics/cfg/models/v6/yolov6.yaml +1 -1
  60. ultralytics/cfg/models/v8/yoloe-v8-seg.yaml +9 -6
  61. ultralytics/cfg/models/v8/yoloe-v8.yaml +9 -6
  62. ultralytics/cfg/models/v8/yolov8-cls-resnet101.yaml +1 -1
  63. ultralytics/cfg/models/v8/yolov8-cls-resnet50.yaml +1 -1
  64. ultralytics/cfg/models/v8/yolov8-ghost-p2.yaml +2 -2
  65. ultralytics/cfg/models/v8/yolov8-ghost-p6.yaml +2 -2
  66. ultralytics/cfg/models/v8/yolov8-ghost.yaml +2 -2
  67. ultralytics/cfg/models/v8/yolov8-obb.yaml +1 -1
  68. ultralytics/cfg/models/v8/yolov8-p2.yaml +1 -1
  69. ultralytics/cfg/models/v8/yolov8-pose-p6.yaml +1 -1
  70. ultralytics/cfg/models/v8/yolov8-rtdetr.yaml +1 -1
  71. ultralytics/cfg/models/v8/yolov8-seg-p6.yaml +1 -1
  72. ultralytics/cfg/models/v8/yolov8-world.yaml +1 -1
  73. ultralytics/cfg/models/v8/yolov8-worldv2.yaml +6 -6
  74. ultralytics/cfg/models/v9/yolov9s.yaml +1 -1
  75. ultralytics/data/__init__.py +4 -4
  76. ultralytics/data/annotator.py +5 -6
  77. ultralytics/data/augment.py +300 -475
  78. ultralytics/data/base.py +18 -26
  79. ultralytics/data/build.py +147 -25
  80. ultralytics/data/converter.py +108 -87
  81. ultralytics/data/dataset.py +47 -75
  82. ultralytics/data/loaders.py +42 -49
  83. ultralytics/data/split.py +5 -6
  84. ultralytics/data/split_dota.py +8 -15
  85. ultralytics/data/utils.py +36 -45
  86. ultralytics/engine/exporter.py +351 -263
  87. ultralytics/engine/model.py +186 -225
  88. ultralytics/engine/predictor.py +45 -54
  89. ultralytics/engine/results.py +198 -325
  90. ultralytics/engine/trainer.py +165 -106
  91. ultralytics/engine/tuner.py +41 -43
  92. ultralytics/engine/validator.py +55 -38
  93. ultralytics/hub/__init__.py +16 -19
  94. ultralytics/hub/auth.py +6 -12
  95. ultralytics/hub/google/__init__.py +7 -10
  96. ultralytics/hub/session.py +15 -25
  97. ultralytics/hub/utils.py +5 -8
  98. ultralytics/models/__init__.py +1 -1
  99. ultralytics/models/fastsam/__init__.py +1 -1
  100. ultralytics/models/fastsam/model.py +8 -10
  101. ultralytics/models/fastsam/predict.py +18 -30
  102. ultralytics/models/fastsam/utils.py +1 -2
  103. ultralytics/models/fastsam/val.py +5 -7
  104. ultralytics/models/nas/__init__.py +1 -1
  105. ultralytics/models/nas/model.py +5 -8
  106. ultralytics/models/nas/predict.py +7 -9
  107. ultralytics/models/nas/val.py +1 -2
  108. ultralytics/models/rtdetr/__init__.py +1 -1
  109. ultralytics/models/rtdetr/model.py +5 -8
  110. ultralytics/models/rtdetr/predict.py +15 -19
  111. ultralytics/models/rtdetr/train.py +10 -13
  112. ultralytics/models/rtdetr/val.py +21 -23
  113. ultralytics/models/sam/__init__.py +15 -2
  114. ultralytics/models/sam/amg.py +14 -20
  115. ultralytics/models/sam/build.py +26 -19
  116. ultralytics/models/sam/build_sam3.py +377 -0
  117. ultralytics/models/sam/model.py +29 -32
  118. ultralytics/models/sam/modules/blocks.py +83 -144
  119. ultralytics/models/sam/modules/decoders.py +19 -37
  120. ultralytics/models/sam/modules/encoders.py +44 -101
  121. ultralytics/models/sam/modules/memory_attention.py +16 -30
  122. ultralytics/models/sam/modules/sam.py +200 -73
  123. ultralytics/models/sam/modules/tiny_encoder.py +64 -83
  124. ultralytics/models/sam/modules/transformer.py +18 -28
  125. ultralytics/models/sam/modules/utils.py +174 -50
  126. ultralytics/models/sam/predict.py +2248 -350
  127. ultralytics/models/sam/sam3/__init__.py +3 -0
  128. ultralytics/models/sam/sam3/decoder.py +546 -0
  129. ultralytics/models/sam/sam3/encoder.py +529 -0
  130. ultralytics/models/sam/sam3/geometry_encoders.py +415 -0
  131. ultralytics/models/sam/sam3/maskformer_segmentation.py +286 -0
  132. ultralytics/models/sam/sam3/model_misc.py +199 -0
  133. ultralytics/models/sam/sam3/necks.py +129 -0
  134. ultralytics/models/sam/sam3/sam3_image.py +339 -0
  135. ultralytics/models/sam/sam3/text_encoder_ve.py +307 -0
  136. ultralytics/models/sam/sam3/vitdet.py +547 -0
  137. ultralytics/models/sam/sam3/vl_combiner.py +160 -0
  138. ultralytics/models/utils/loss.py +14 -26
  139. ultralytics/models/utils/ops.py +13 -17
  140. ultralytics/models/yolo/__init__.py +1 -1
  141. ultralytics/models/yolo/classify/predict.py +10 -13
  142. ultralytics/models/yolo/classify/train.py +12 -33
  143. ultralytics/models/yolo/classify/val.py +30 -29
  144. ultralytics/models/yolo/detect/predict.py +9 -12
  145. ultralytics/models/yolo/detect/train.py +17 -23
  146. ultralytics/models/yolo/detect/val.py +77 -59
  147. ultralytics/models/yolo/model.py +43 -60
  148. ultralytics/models/yolo/obb/predict.py +7 -16
  149. ultralytics/models/yolo/obb/train.py +14 -17
  150. ultralytics/models/yolo/obb/val.py +40 -37
  151. ultralytics/models/yolo/pose/__init__.py +1 -1
  152. ultralytics/models/yolo/pose/predict.py +7 -22
  153. ultralytics/models/yolo/pose/train.py +13 -16
  154. ultralytics/models/yolo/pose/val.py +39 -58
  155. ultralytics/models/yolo/segment/predict.py +17 -21
  156. ultralytics/models/yolo/segment/train.py +7 -10
  157. ultralytics/models/yolo/segment/val.py +95 -47
  158. ultralytics/models/yolo/world/train.py +8 -14
  159. ultralytics/models/yolo/world/train_world.py +11 -34
  160. ultralytics/models/yolo/yoloe/__init__.py +7 -7
  161. ultralytics/models/yolo/yoloe/predict.py +16 -23
  162. ultralytics/models/yolo/yoloe/train.py +36 -44
  163. ultralytics/models/yolo/yoloe/train_seg.py +11 -11
  164. ultralytics/models/yolo/yoloe/val.py +15 -20
  165. ultralytics/nn/__init__.py +7 -7
  166. ultralytics/nn/autobackend.py +159 -85
  167. ultralytics/nn/modules/__init__.py +68 -60
  168. ultralytics/nn/modules/activation.py +4 -6
  169. ultralytics/nn/modules/block.py +260 -224
  170. ultralytics/nn/modules/conv.py +52 -97
  171. ultralytics/nn/modules/head.py +831 -299
  172. ultralytics/nn/modules/transformer.py +76 -88
  173. ultralytics/nn/modules/utils.py +16 -21
  174. ultralytics/nn/tasks.py +180 -195
  175. ultralytics/nn/text_model.py +45 -69
  176. ultralytics/optim/__init__.py +5 -0
  177. ultralytics/optim/muon.py +338 -0
  178. ultralytics/solutions/__init__.py +12 -12
  179. ultralytics/solutions/ai_gym.py +13 -19
  180. ultralytics/solutions/analytics.py +15 -16
  181. ultralytics/solutions/config.py +6 -7
  182. ultralytics/solutions/distance_calculation.py +10 -13
  183. ultralytics/solutions/heatmap.py +8 -14
  184. ultralytics/solutions/instance_segmentation.py +6 -9
  185. ultralytics/solutions/object_blurrer.py +7 -10
  186. ultralytics/solutions/object_counter.py +12 -19
  187. ultralytics/solutions/object_cropper.py +8 -14
  188. ultralytics/solutions/parking_management.py +34 -32
  189. ultralytics/solutions/queue_management.py +10 -12
  190. ultralytics/solutions/region_counter.py +9 -12
  191. ultralytics/solutions/security_alarm.py +15 -20
  192. ultralytics/solutions/similarity_search.py +10 -15
  193. ultralytics/solutions/solutions.py +77 -76
  194. ultralytics/solutions/speed_estimation.py +7 -10
  195. ultralytics/solutions/streamlit_inference.py +2 -4
  196. ultralytics/solutions/templates/similarity-search.html +7 -18
  197. ultralytics/solutions/trackzone.py +7 -10
  198. ultralytics/solutions/vision_eye.py +5 -8
  199. ultralytics/trackers/__init__.py +1 -1
  200. ultralytics/trackers/basetrack.py +3 -5
  201. ultralytics/trackers/bot_sort.py +10 -27
  202. ultralytics/trackers/byte_tracker.py +21 -37
  203. ultralytics/trackers/track.py +4 -7
  204. ultralytics/trackers/utils/gmc.py +11 -22
  205. ultralytics/trackers/utils/kalman_filter.py +37 -48
  206. ultralytics/trackers/utils/matching.py +12 -15
  207. ultralytics/utils/__init__.py +124 -124
  208. ultralytics/utils/autobatch.py +2 -4
  209. ultralytics/utils/autodevice.py +17 -18
  210. ultralytics/utils/benchmarks.py +57 -71
  211. ultralytics/utils/callbacks/base.py +8 -10
  212. ultralytics/utils/callbacks/clearml.py +5 -13
  213. ultralytics/utils/callbacks/comet.py +32 -46
  214. ultralytics/utils/callbacks/dvc.py +13 -18
  215. ultralytics/utils/callbacks/mlflow.py +4 -5
  216. ultralytics/utils/callbacks/neptune.py +7 -15
  217. ultralytics/utils/callbacks/platform.py +423 -38
  218. ultralytics/utils/callbacks/raytune.py +3 -4
  219. ultralytics/utils/callbacks/tensorboard.py +25 -31
  220. ultralytics/utils/callbacks/wb.py +16 -14
  221. ultralytics/utils/checks.py +127 -85
  222. ultralytics/utils/cpu.py +3 -8
  223. ultralytics/utils/dist.py +9 -12
  224. ultralytics/utils/downloads.py +25 -33
  225. ultralytics/utils/errors.py +6 -14
  226. ultralytics/utils/events.py +2 -4
  227. ultralytics/utils/export/__init__.py +4 -236
  228. ultralytics/utils/export/engine.py +246 -0
  229. ultralytics/utils/export/imx.py +117 -63
  230. ultralytics/utils/export/tensorflow.py +231 -0
  231. ultralytics/utils/files.py +26 -30
  232. ultralytics/utils/git.py +9 -11
  233. ultralytics/utils/instance.py +30 -51
  234. ultralytics/utils/logger.py +212 -114
  235. ultralytics/utils/loss.py +601 -215
  236. ultralytics/utils/metrics.py +128 -156
  237. ultralytics/utils/nms.py +13 -16
  238. ultralytics/utils/ops.py +117 -166
  239. ultralytics/utils/patches.py +75 -21
  240. ultralytics/utils/plotting.py +75 -80
  241. ultralytics/utils/tal.py +125 -59
  242. ultralytics/utils/torch_utils.py +53 -79
  243. ultralytics/utils/tqdm.py +24 -21
  244. ultralytics/utils/triton.py +13 -19
  245. ultralytics/utils/tuner.py +19 -10
  246. dgenerate_ultralytics_headless-8.3.214.dist-info/RECORD +0 -283
  247. {dgenerate_ultralytics_headless-8.3.214.dist-info → dgenerate_ultralytics_headless-8.4.7.dist-info}/entry_points.txt +0 -0
  248. {dgenerate_ultralytics_headless-8.3.214.dist-info → dgenerate_ultralytics_headless-8.4.7.dist-info}/licenses/LICENSE +0 -0
  249. {dgenerate_ultralytics_headless-8.3.214.dist-info → dgenerate_ultralytics_headless-8.4.7.dist-info}/top_level.txt +0 -0
tests/test_exports.py CHANGED
@@ -12,15 +12,8 @@ import pytest
12
12
  from tests import MODEL, SOURCE
13
13
  from ultralytics import YOLO
14
14
  from ultralytics.cfg import TASK2DATA, TASK2MODEL, TASKS
15
- from ultralytics.utils import (
16
- ARM64,
17
- IS_RASPBERRYPI,
18
- LINUX,
19
- MACOS,
20
- WINDOWS,
21
- checks,
22
- )
23
- from ultralytics.utils.torch_utils import TORCH_1_11, TORCH_1_13, TORCH_2_1
15
+ from ultralytics.utils import ARM64, IS_RASPBERRYPI, LINUX, MACOS, MACOS_VERSION, WINDOWS, checks
16
+ from ultralytics.utils.torch_utils import TORCH_1_10, TORCH_1_11, TORCH_1_13, TORCH_2_0, TORCH_2_1, TORCH_2_8, TORCH_2_9
24
17
 
25
18
 
26
19
  def test_export_torchscript():
@@ -119,6 +112,9 @@ def test_export_torchscript_matrix(task, dynamic, int8, half, batch, nms):
119
112
  @pytest.mark.skipif(not MACOS, reason="CoreML inference only supported on macOS")
120
113
  @pytest.mark.skipif(not TORCH_1_11, reason="CoreML export requires torch>=1.11")
121
114
  @pytest.mark.skipif(checks.IS_PYTHON_3_13, reason="CoreML not supported in Python 3.13")
115
+ @pytest.mark.skipif(
116
+ MACOS and MACOS_VERSION and MACOS_VERSION >= "15", reason="CoreML YOLO26 matrix test crashes on macOS 15+"
117
+ )
122
118
  @pytest.mark.parametrize(
123
119
  "task, dynamic, int8, half, nms, batch",
124
120
  [ # generate all combinations except for exclusion cases
@@ -148,7 +144,9 @@ def test_export_coreml_matrix(task, dynamic, int8, half, nms, batch):
148
144
 
149
145
 
150
146
  @pytest.mark.slow
151
- @pytest.mark.skipif(not checks.IS_PYTHON_MINIMUM_3_10, reason="TFLite export requires Python>=3.10")
147
+ @pytest.mark.skipif(
148
+ not checks.IS_PYTHON_MINIMUM_3_10 or not TORCH_1_13, reason="TFLite export requires Python>=3.10 and torch>=1.13"
149
+ )
152
150
  @pytest.mark.skipif(
153
151
  not LINUX or IS_RASPBERRYPI,
154
152
  reason="Test disabled as TF suffers from install conflicts on Windows, macOS and Raspberry Pi",
@@ -217,6 +215,7 @@ def test_export_paddle():
217
215
 
218
216
 
219
217
  @pytest.mark.slow
218
+ @pytest.mark.skipif(not TORCH_1_10, reason="MNN export requires torch>=1.10")
220
219
  def test_export_mnn():
221
220
  """Test YOLO export to MNN format (WARNING: MNN test must precede NCNN test or CI error on Windows)."""
222
221
  file = YOLO(MODEL).export(format="mnn", imgsz=32)
@@ -224,6 +223,7 @@ def test_export_mnn():
224
223
 
225
224
 
226
225
  @pytest.mark.slow
226
+ @pytest.mark.skipif(not TORCH_1_10, reason="MNN export requires torch>=1.10")
227
227
  @pytest.mark.parametrize(
228
228
  "task, int8, half, batch",
229
229
  [ # generate all combinations except for exclusion cases
@@ -240,6 +240,7 @@ def test_export_mnn_matrix(task, int8, half, batch):
240
240
 
241
241
 
242
242
  @pytest.mark.slow
243
+ @pytest.mark.skipif(not TORCH_2_0, reason="NCNN inference causes segfault on PyTorch<2.0")
243
244
  def test_export_ncnn():
244
245
  """Test YOLO export to NCNN format."""
245
246
  file = YOLO(MODEL).export(format="ncnn", imgsz=32)
@@ -247,6 +248,7 @@ def test_export_ncnn():
247
248
 
248
249
 
249
250
  @pytest.mark.slow
251
+ @pytest.mark.skipif(not TORCH_2_0, reason="NCNN inference causes segfault on PyTorch<2.0")
250
252
  @pytest.mark.parametrize("task, half, batch", list(product(TASKS, [True, False], [1])))
251
253
  def test_export_ncnn_matrix(task, half, batch):
252
254
  """Test YOLO export to NCNN format considering various export configurations."""
@@ -255,10 +257,60 @@ def test_export_ncnn_matrix(task, half, batch):
255
257
  shutil.rmtree(file, ignore_errors=True) # retry in case of potential lingering multi-threaded file usage errors
256
258
 
257
259
 
258
- @pytest.mark.skipif(True, reason="Test disabled as keras and tensorflow version conflicts with TFlite export.")
259
- @pytest.mark.skipif(not LINUX or MACOS, reason="Skipping test on Windows and Macos")
260
+ @pytest.mark.skipif(not TORCH_2_9, reason="IMX export requires torch>=2.9.0")
261
+ @pytest.mark.skipif(not checks.IS_PYTHON_MINIMUM_3_9, reason="Requires Python>=3.9")
262
+ @pytest.mark.skipif(WINDOWS or MACOS, reason="Skipping test on Windows and Macos")
263
+ @pytest.mark.skipif(ARM64, reason="IMX export is not supported on ARM64 architectures.")
260
264
  def test_export_imx():
261
265
  """Test YOLO export to IMX format."""
262
- model = YOLO("yolov8n.pt")
266
+ model = YOLO("yolo11n.pt") # IMX export only supports YOLO11
263
267
  file = model.export(format="imx", imgsz=32)
264
268
  YOLO(file)(SOURCE, imgsz=32)
269
+
270
+
271
+ @pytest.mark.slow
272
+ @pytest.mark.skipif(not TORCH_2_8, reason="Axelera export requires torch>=2.8.0")
273
+ @pytest.mark.skipif(not LINUX, reason="Axelera export only supported on Linux")
274
+ @pytest.mark.skipif(not checks.IS_PYTHON_3_10, reason="Axelera export requires Python 3.10")
275
+ def test_export_axelera():
276
+ """Test YOLO export to Axelera format."""
277
+ # For faster testing, use a smaller calibration dataset (32 image size crashes axelera export, so 64 is used)
278
+ file = YOLO(MODEL).export(format="axelera", imgsz=64, data="coco8.yaml")
279
+ assert Path(file).exists(), f"Axelera export failed, directory not found: {file}"
280
+ shutil.rmtree(file, ignore_errors=True) # cleanup
281
+
282
+
283
+ # @pytest.mark.skipif(True, reason="Disabled for debugging ruamel.yaml installation required by executorch")
284
+ @pytest.mark.skipif(not checks.IS_PYTHON_MINIMUM_3_10 or not TORCH_2_9, reason="Requires Python>=3.10 and Torch>=2.9.0")
285
+ @pytest.mark.skipif(WINDOWS, reason="Skipping test on Windows")
286
+ def test_export_executorch():
287
+ """Test YOLO model export to ExecuTorch format."""
288
+ file = YOLO(MODEL).export(format="executorch", imgsz=32)
289
+ assert Path(file).exists(), f"ExecuTorch export failed, directory not found: {file}"
290
+ # Check that .pte file exists in the exported directory
291
+ pte_file = Path(file) / Path(MODEL).with_suffix(".pte").name
292
+ assert pte_file.exists(), f"ExecuTorch .pte file not found: {pte_file}"
293
+ # Check that metadata.yaml exists
294
+ metadata_file = Path(file) / "metadata.yaml"
295
+ assert metadata_file.exists(), f"ExecuTorch metadata.yaml not found: {metadata_file}"
296
+ # Note: Inference testing skipped as ExecuTorch requires special runtime setup
297
+ shutil.rmtree(file, ignore_errors=True) # cleanup
298
+
299
+
300
+ @pytest.mark.slow
301
+ @pytest.mark.skipif(not checks.IS_PYTHON_MINIMUM_3_10 or not TORCH_2_9, reason="Requires Python>=3.10 and Torch>=2.9.0")
302
+ @pytest.mark.skipif(WINDOWS, reason="Skipping test on Windows")
303
+ @pytest.mark.parametrize("task", TASKS)
304
+ def test_export_executorch_matrix(task):
305
+ """Test YOLO export to ExecuTorch format for various task types."""
306
+ file = YOLO(TASK2MODEL[task]).export(format="executorch", imgsz=32)
307
+ assert Path(file).exists(), f"ExecuTorch export failed for task '{task}', directory not found: {file}"
308
+ # Check that .pte file exists in the exported directory
309
+ model_name = Path(TASK2MODEL[task]).with_suffix(".pte").name
310
+ pte_file = Path(file) / model_name
311
+ assert pte_file.exists(), f"ExecuTorch .pte file not found for task '{task}': {pte_file}"
312
+ # Check that metadata.yaml exists
313
+ metadata_file = Path(file) / "metadata.yaml"
314
+ assert metadata_file.exists(), f"ExecuTorch metadata.yaml not found for task '{task}': {metadata_file}"
315
+ # Note: Inference testing skipped as ExecuTorch requires special runtime setup
316
+ shutil.rmtree(file, ignore_errors=True) # cleanup
@@ -8,7 +8,7 @@ from pathlib import Path
8
8
 
9
9
  import pytest
10
10
 
11
- from tests import MODEL, SOURCE, TMP
11
+ from tests import MODEL, SOURCE
12
12
  from ultralytics import YOLO, download
13
13
  from ultralytics.utils import ASSETS_URL, DATASETS_DIR, SETTINGS
14
14
  from ultralytics.utils.checks import check_requirements
@@ -18,14 +18,14 @@ from ultralytics.utils.checks import check_requirements
18
18
  def test_tensorboard():
19
19
  """Test training with TensorBoard logging enabled."""
20
20
  SETTINGS["tensorboard"] = True
21
- YOLO("yolo11n-cls.yaml").train(data="imagenet10", imgsz=32, epochs=3, plots=False, device="cpu")
21
+ YOLO("yolo26n-cls.yaml").train(data="imagenet10", imgsz=32, epochs=3, plots=False, device="cpu")
22
22
  SETTINGS["tensorboard"] = False
23
23
 
24
24
 
25
25
  @pytest.mark.skipif(not check_requirements("ray", install=False), reason="ray[tune] not installed")
26
26
  def test_model_ray_tune():
27
27
  """Tune YOLO model using Ray for hyperparameter optimization."""
28
- YOLO("yolo11n-cls.yaml").tune(
28
+ YOLO("yolo26n-cls.yaml").tune(
29
29
  use_ray=True, data="imagenet10", grace_period=1, iterations=1, imgsz=32, epochs=1, plots=False, device="cpu"
30
30
  )
31
31
 
@@ -34,7 +34,7 @@ def test_model_ray_tune():
34
34
  def test_mlflow():
35
35
  """Test training with MLflow tracking enabled."""
36
36
  SETTINGS["mlflow"] = True
37
- YOLO("yolo11n-cls.yaml").train(data="imagenet10", imgsz=32, epochs=3, plots=False, device="cpu")
37
+ YOLO("yolo26n-cls.yaml").train(data="imagenet10", imgsz=32, epochs=3, plots=False, device="cpu")
38
38
  SETTINGS["mlflow"] = False
39
39
 
40
40
 
@@ -50,7 +50,7 @@ def test_mlflow_keep_run_active():
50
50
 
51
51
  # Test with MLFLOW_KEEP_RUN_ACTIVE=True
52
52
  os.environ["MLFLOW_KEEP_RUN_ACTIVE"] = "True"
53
- YOLO("yolo11n-cls.yaml").train(data="imagenet10", imgsz=32, epochs=1, plots=False, device="cpu")
53
+ YOLO("yolo26n-cls.yaml").train(data="imagenet10", imgsz=32, epochs=1, plots=False, device="cpu")
54
54
  status = mlflow.active_run().info.status
55
55
  assert status == "RUNNING", "MLflow run should be active when MLFLOW_KEEP_RUN_ACTIVE=True"
56
56
 
@@ -58,27 +58,27 @@ def test_mlflow_keep_run_active():
58
58
 
59
59
  # Test with MLFLOW_KEEP_RUN_ACTIVE=False
60
60
  os.environ["MLFLOW_KEEP_RUN_ACTIVE"] = "False"
61
- YOLO("yolo11n-cls.yaml").train(data="imagenet10", imgsz=32, epochs=1, plots=False, device="cpu")
61
+ YOLO("yolo26n-cls.yaml").train(data="imagenet10", imgsz=32, epochs=1, plots=False, device="cpu")
62
62
  status = mlflow.get_run(run_id=run_id).info.status
63
63
  assert status == "FINISHED", "MLflow run should be ended when MLFLOW_KEEP_RUN_ACTIVE=False"
64
64
 
65
65
  # Test with MLFLOW_KEEP_RUN_ACTIVE not set
66
66
  os.environ.pop("MLFLOW_KEEP_RUN_ACTIVE", None)
67
- YOLO("yolo11n-cls.yaml").train(data="imagenet10", imgsz=32, epochs=1, plots=False, device="cpu")
67
+ YOLO("yolo26n-cls.yaml").train(data="imagenet10", imgsz=32, epochs=1, plots=False, device="cpu")
68
68
  status = mlflow.get_run(run_id=run_id).info.status
69
69
  assert status == "FINISHED", "MLflow run should be ended by default when MLFLOW_KEEP_RUN_ACTIVE is not set"
70
70
  SETTINGS["mlflow"] = False
71
71
 
72
72
 
73
73
  @pytest.mark.skipif(not check_requirements("tritonclient", install=False), reason="tritonclient[all] not installed")
74
- def test_triton():
74
+ def test_triton(tmp_path):
75
75
  """Test NVIDIA Triton Server functionalities with YOLO model."""
76
76
  check_requirements("tritonclient[all]")
77
- from tritonclient.http import InferenceServerClient # noqa
77
+ from tritonclient.http import InferenceServerClient
78
78
 
79
79
  # Create variables
80
80
  model_name = "yolo"
81
- triton_repo = TMP / "triton_repo" # Triton repo path
81
+ triton_repo = tmp_path / "triton_repo" # Triton repo path
82
82
  triton_model = triton_repo / model_name # Triton model path
83
83
 
84
84
  # Export model to ONNX
@@ -129,21 +129,21 @@ def test_faster_coco_eval():
129
129
  from ultralytics.models.yolo.pose import PoseValidator
130
130
  from ultralytics.models.yolo.segment import SegmentationValidator
131
131
 
132
- args = {"model": "yolo11n.pt", "data": "coco8.yaml", "save_json": True, "imgsz": 64}
132
+ args = {"model": "yolo26n.pt", "data": "coco8.yaml", "save_json": True, "imgsz": 64}
133
133
  validator = DetectionValidator(args=args)
134
134
  validator()
135
135
  validator.is_coco = True
136
136
  download(f"{ASSETS_URL}/instances_val2017.json", dir=DATASETS_DIR / "coco8/annotations")
137
137
  _ = validator.eval_json(validator.stats)
138
138
 
139
- args = {"model": "yolo11n-seg.pt", "data": "coco8-seg.yaml", "save_json": True, "imgsz": 64}
139
+ args = {"model": "yolo26n-seg.pt", "data": "coco8-seg.yaml", "save_json": True, "imgsz": 64}
140
140
  validator = SegmentationValidator(args=args)
141
141
  validator()
142
142
  validator.is_coco = True
143
143
  download(f"{ASSETS_URL}/instances_val2017.json", dir=DATASETS_DIR / "coco8-seg/annotations")
144
144
  _ = validator.eval_json(validator.stats)
145
145
 
146
- args = {"model": "yolo11n-pose.pt", "data": "coco8-pose.yaml", "save_json": True, "imgsz": 64}
146
+ args = {"model": "yolo26n-pose.pt", "data": "coco8-pose.yaml", "save_json": True, "imgsz": 64}
147
147
  validator = PoseValidator(args=args)
148
148
  validator()
149
149
  validator.is_coco = True