dgenerate-ultralytics-headless 8.3.253__py3-none-any.whl → 8.4.3__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 (85) hide show
  1. {dgenerate_ultralytics_headless-8.3.253.dist-info → dgenerate_ultralytics_headless-8.4.3.dist-info}/METADATA +41 -49
  2. {dgenerate_ultralytics_headless-8.3.253.dist-info → dgenerate_ultralytics_headless-8.4.3.dist-info}/RECORD +85 -74
  3. tests/__init__.py +2 -2
  4. tests/conftest.py +1 -1
  5. tests/test_cuda.py +8 -2
  6. tests/test_engine.py +8 -8
  7. tests/test_exports.py +11 -4
  8. tests/test_integrations.py +9 -9
  9. tests/test_python.py +14 -14
  10. tests/test_solutions.py +3 -3
  11. ultralytics/__init__.py +1 -1
  12. ultralytics/cfg/__init__.py +25 -27
  13. ultralytics/cfg/default.yaml +3 -1
  14. ultralytics/cfg/models/26/yolo26-cls.yaml +33 -0
  15. ultralytics/cfg/models/26/yolo26-obb.yaml +52 -0
  16. ultralytics/cfg/models/26/yolo26-p2.yaml +60 -0
  17. ultralytics/cfg/models/26/yolo26-p6.yaml +62 -0
  18. ultralytics/cfg/models/26/yolo26-pose.yaml +53 -0
  19. ultralytics/cfg/models/26/yolo26-seg.yaml +52 -0
  20. ultralytics/cfg/models/26/yolo26.yaml +52 -0
  21. ultralytics/cfg/models/26/yoloe-26-seg.yaml +53 -0
  22. ultralytics/cfg/models/26/yoloe-26.yaml +53 -0
  23. ultralytics/data/annotator.py +2 -2
  24. ultralytics/data/augment.py +7 -0
  25. ultralytics/data/converter.py +57 -38
  26. ultralytics/data/dataset.py +1 -1
  27. ultralytics/engine/exporter.py +31 -26
  28. ultralytics/engine/model.py +34 -34
  29. ultralytics/engine/predictor.py +17 -17
  30. ultralytics/engine/results.py +14 -12
  31. ultralytics/engine/trainer.py +59 -29
  32. ultralytics/engine/tuner.py +19 -11
  33. ultralytics/engine/validator.py +16 -16
  34. ultralytics/models/fastsam/predict.py +1 -1
  35. ultralytics/models/yolo/classify/predict.py +1 -1
  36. ultralytics/models/yolo/classify/train.py +1 -1
  37. ultralytics/models/yolo/classify/val.py +1 -1
  38. ultralytics/models/yolo/detect/predict.py +2 -2
  39. ultralytics/models/yolo/detect/train.py +4 -3
  40. ultralytics/models/yolo/detect/val.py +7 -1
  41. ultralytics/models/yolo/model.py +8 -8
  42. ultralytics/models/yolo/obb/predict.py +2 -2
  43. ultralytics/models/yolo/obb/train.py +3 -3
  44. ultralytics/models/yolo/obb/val.py +1 -1
  45. ultralytics/models/yolo/pose/predict.py +1 -1
  46. ultralytics/models/yolo/pose/train.py +3 -1
  47. ultralytics/models/yolo/pose/val.py +1 -1
  48. ultralytics/models/yolo/segment/predict.py +3 -3
  49. ultralytics/models/yolo/segment/train.py +4 -4
  50. ultralytics/models/yolo/segment/val.py +4 -2
  51. ultralytics/models/yolo/yoloe/train.py +6 -1
  52. ultralytics/models/yolo/yoloe/train_seg.py +6 -1
  53. ultralytics/nn/autobackend.py +5 -5
  54. ultralytics/nn/modules/__init__.py +8 -0
  55. ultralytics/nn/modules/block.py +128 -8
  56. ultralytics/nn/modules/head.py +788 -203
  57. ultralytics/nn/tasks.py +86 -41
  58. ultralytics/nn/text_model.py +5 -2
  59. ultralytics/optim/__init__.py +5 -0
  60. ultralytics/optim/muon.py +338 -0
  61. ultralytics/solutions/ai_gym.py +3 -3
  62. ultralytics/solutions/config.py +1 -1
  63. ultralytics/solutions/heatmap.py +1 -1
  64. ultralytics/solutions/instance_segmentation.py +2 -2
  65. ultralytics/solutions/parking_management.py +1 -1
  66. ultralytics/solutions/solutions.py +2 -2
  67. ultralytics/trackers/track.py +1 -1
  68. ultralytics/utils/__init__.py +8 -8
  69. ultralytics/utils/benchmarks.py +23 -23
  70. ultralytics/utils/callbacks/platform.py +11 -7
  71. ultralytics/utils/checks.py +6 -6
  72. ultralytics/utils/downloads.py +5 -3
  73. ultralytics/utils/export/engine.py +19 -10
  74. ultralytics/utils/export/imx.py +19 -13
  75. ultralytics/utils/export/tensorflow.py +21 -21
  76. ultralytics/utils/files.py +2 -2
  77. ultralytics/utils/loss.py +587 -203
  78. ultralytics/utils/metrics.py +1 -0
  79. ultralytics/utils/ops.py +11 -2
  80. ultralytics/utils/tal.py +98 -19
  81. ultralytics/utils/tuner.py +2 -2
  82. {dgenerate_ultralytics_headless-8.3.253.dist-info → dgenerate_ultralytics_headless-8.4.3.dist-info}/WHEEL +0 -0
  83. {dgenerate_ultralytics_headless-8.3.253.dist-info → dgenerate_ultralytics_headless-8.4.3.dist-info}/entry_points.txt +0 -0
  84. {dgenerate_ultralytics_headless-8.3.253.dist-info → dgenerate_ultralytics_headless-8.4.3.dist-info}/licenses/LICENSE +0 -0
  85. {dgenerate_ultralytics_headless-8.3.253.dist-info → dgenerate_ultralytics_headless-8.4.3.dist-info}/top_level.txt +0 -0
tests/test_engine.py CHANGED
@@ -5,7 +5,7 @@ from unittest import mock
5
5
 
6
6
  import torch
7
7
 
8
- from tests import MODEL
8
+ from tests import MODEL, SOURCE
9
9
  from ultralytics import YOLO
10
10
  from ultralytics.cfg import get_cfg
11
11
  from ultralytics.engine.exporter import Exporter
@@ -23,13 +23,13 @@ def test_export():
23
23
  exporter = Exporter()
24
24
  exporter.add_callback("on_export_start", test_func)
25
25
  assert test_func in exporter.callbacks["on_export_start"], "callback test failed"
26
- f = exporter(model=YOLO("yolo11n.yaml").model)
27
- YOLO(f)(ASSETS) # exported model inference
26
+ f = exporter(model=YOLO("yolo26n.yaml").model)
27
+ YOLO(f)(SOURCE) # exported model inference
28
28
 
29
29
 
30
30
  def test_detect():
31
31
  """Test YOLO object detection training, validation, and prediction functionality."""
32
- overrides = {"data": "coco8.yaml", "model": "yolo11n.yaml", "imgsz": 32, "epochs": 1, "save": False}
32
+ overrides = {"data": "coco8.yaml", "model": "yolo26n.yaml", "imgsz": 32, "epochs": 1, "save": False}
33
33
  cfg = get_cfg(DEFAULT_CFG)
34
34
  cfg.data = "coco8.yaml"
35
35
  cfg.imgsz = 32
@@ -71,7 +71,7 @@ def test_segment():
71
71
  """Test image segmentation training, validation, and prediction pipelines using YOLO models."""
72
72
  overrides = {
73
73
  "data": "coco8-seg.yaml",
74
- "model": "yolo11n-seg.yaml",
74
+ "model": "yolo26n-seg.yaml",
75
75
  "imgsz": 32,
76
76
  "epochs": 1,
77
77
  "save": False,
@@ -98,7 +98,7 @@ def test_segment():
98
98
  pred = segment.SegmentationPredictor(overrides={"imgsz": [64, 64]})
99
99
  pred.add_callback("on_predict_start", test_func)
100
100
  assert test_func in pred.callbacks["on_predict_start"], "callback test failed"
101
- result = pred(source=ASSETS, model=WEIGHTS_DIR / "yolo11n-seg.pt")
101
+ result = pred(source=ASSETS, model=WEIGHTS_DIR / "yolo26n-seg.pt")
102
102
  assert len(result), "predictor test failed"
103
103
 
104
104
  # Test resume functionality
@@ -115,7 +115,7 @@ def test_segment():
115
115
 
116
116
  def test_classify():
117
117
  """Test image classification including training, validation, and prediction phases."""
118
- overrides = {"data": "imagenet10", "model": "yolo11n-cls.yaml", "imgsz": 32, "epochs": 1, "save": False}
118
+ overrides = {"data": "imagenet10", "model": "yolo26n-cls.yaml", "imgsz": 32, "epochs": 1, "save": False}
119
119
  cfg = get_cfg(DEFAULT_CFG)
120
120
  cfg.data = "imagenet10"
121
121
  cfg.imgsz = 32
@@ -150,7 +150,7 @@ def test_nan_recovery():
150
150
  trainer.tloss *= torch.tensor(float("nan"))
151
151
  nan_injected[0] = True
152
152
 
153
- overrides = {"data": "coco8.yaml", "model": "yolo11n.yaml", "imgsz": 32, "epochs": 3}
153
+ overrides = {"data": "coco8.yaml", "model": "yolo26n.yaml", "imgsz": 32, "epochs": 3}
154
154
  trainer = detect.DetectionTrainer(overrides=overrides)
155
155
  trainer.add_callback("on_train_batch_end", inject_nan)
156
156
  trainer.train()
tests/test_exports.py CHANGED
@@ -12,8 +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 ARM64, IS_RASPBERRYPI, LINUX, MACOS, WINDOWS, checks
16
- from ultralytics.utils.torch_utils import TORCH_1_10, TORCH_1_11, TORCH_1_13, TORCH_2_1, TORCH_2_8, TORCH_2_9
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
17
17
 
18
18
 
19
19
  def test_export_torchscript():
@@ -112,6 +112,9 @@ def test_export_torchscript_matrix(task, dynamic, int8, half, batch, nms):
112
112
  @pytest.mark.skipif(not MACOS, reason="CoreML inference only supported on macOS")
113
113
  @pytest.mark.skipif(not TORCH_1_11, reason="CoreML export requires torch>=1.11")
114
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
+ )
115
118
  @pytest.mark.parametrize(
116
119
  "task, dynamic, int8, half, nms, batch",
117
120
  [ # generate all combinations except for exclusion cases
@@ -141,7 +144,9 @@ def test_export_coreml_matrix(task, dynamic, int8, half, nms, batch):
141
144
 
142
145
 
143
146
  @pytest.mark.slow
144
- @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
+ )
145
150
  @pytest.mark.skipif(
146
151
  not LINUX or IS_RASPBERRYPI,
147
152
  reason="Test disabled as TF suffers from install conflicts on Windows, macOS and Raspberry Pi",
@@ -235,6 +240,7 @@ def test_export_mnn_matrix(task, int8, half, batch):
235
240
 
236
241
 
237
242
  @pytest.mark.slow
243
+ @pytest.mark.skipif(not TORCH_2_0, reason="NCNN inference causes segfault on PyTorch<2.0")
238
244
  def test_export_ncnn():
239
245
  """Test YOLO export to NCNN format."""
240
246
  file = YOLO(MODEL).export(format="ncnn", imgsz=32)
@@ -242,6 +248,7 @@ def test_export_ncnn():
242
248
 
243
249
 
244
250
  @pytest.mark.slow
251
+ @pytest.mark.skipif(not TORCH_2_0, reason="NCNN inference causes segfault on PyTorch<2.0")
245
252
  @pytest.mark.parametrize("task, half, batch", list(product(TASKS, [True, False], [1])))
246
253
  def test_export_ncnn_matrix(task, half, batch):
247
254
  """Test YOLO export to NCNN format considering various export configurations."""
@@ -256,7 +263,7 @@ def test_export_ncnn_matrix(task, half, batch):
256
263
  @pytest.mark.skipif(ARM64, reason="IMX export is not supported on ARM64 architectures.")
257
264
  def test_export_imx():
258
265
  """Test YOLO export to IMX format."""
259
- model = YOLO(MODEL)
266
+ model = YOLO("yolo11n.pt") # IMX export only supports YOLO11
260
267
  file = model.export(format="imx", imgsz=32)
261
268
  YOLO(file)(SOURCE, imgsz=32)
262
269
 
@@ -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,13 +58,13 @@ 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
@@ -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
tests/test_python.py CHANGED
@@ -179,7 +179,7 @@ def test_track_stream(model, tmp_path):
179
179
 
180
180
  Note imgsz=160 required for tracking for higher confidence and better matches.
181
181
  """
182
- if model == "yolo11n-cls.pt": # classification model not supported for tracking
182
+ if model == "yolo26n-cls.pt": # classification model not supported for tracking
183
183
  return
184
184
  video_url = f"{ASSETS_URL}/decelera_portrait_min.mov"
185
185
  model = YOLO(model)
@@ -187,7 +187,7 @@ def test_track_stream(model, tmp_path):
187
187
  model.track(video_url, imgsz=160, tracker="botsort.yaml", save_frames=True) # test frame saving also
188
188
 
189
189
  # Test Global Motion Compensation (GMC) methods and ReID
190
- for gmc, reidm in zip(["orb", "sift", "ecc"], ["auto", "auto", "yolo11n-cls.pt"]):
190
+ for gmc, reidm in zip(["orb", "sift", "ecc"], ["auto", "auto", "yolo26n-cls.pt"]):
191
191
  default_args = YAML.load(ROOT / "cfg/trackers/botsort.yaml")
192
192
  custom_yaml = tmp_path / f"botsort-{gmc}.yaml"
193
193
  YAML.save(custom_yaml, {**default_args, "gmc_method": gmc, "with_reid": True, "model": reidm})
@@ -220,14 +220,14 @@ def test_train_scratch():
220
220
  @pytest.mark.skipif(not ONLINE, reason="environment is offline")
221
221
  def test_train_ndjson():
222
222
  """Test training the YOLO model using NDJSON format dataset."""
223
- model = YOLO(WEIGHTS_DIR / "yolo11n.pt")
223
+ model = YOLO(WEIGHTS_DIR / "yolo26n.pt")
224
224
  model.train(data=f"{ASSETS_URL}/coco8-ndjson.ndjson", epochs=1, imgsz=32)
225
225
 
226
226
 
227
227
  @pytest.mark.parametrize("scls", [False, True])
228
228
  def test_train_pretrained(scls):
229
229
  """Test training of the YOLO model starting from a pre-trained checkpoint."""
230
- model = YOLO(WEIGHTS_DIR / "yolo11n-seg.pt")
230
+ model = YOLO(WEIGHTS_DIR / "yolo26n-seg.pt")
231
231
  model.train(
232
232
  data="coco8-seg.yaml", epochs=1, imgsz=32, cache="ram", copy_paste=0.5, mixup=0.5, name=0, single_cls=scls
233
233
  )
@@ -280,7 +280,7 @@ def test_predict_callback_and_setup():
280
280
  @pytest.mark.parametrize("model", MODELS)
281
281
  def test_results(model: str, tmp_path):
282
282
  """Test YOLO model results processing and output in various formats."""
283
- im = f"{ASSETS_URL}/boats.jpg" if model == "yolo11n-obb.pt" else SOURCE
283
+ im = f"{ASSETS_URL}/boats.jpg" if model == "yolo26n-obb.pt" else SOURCE
284
284
  results = YOLO(WEIGHTS_DIR / model)([im, im], imgsz=160)
285
285
  for r in results:
286
286
  assert len(r), f"'{model}' results should not be empty!"
@@ -300,13 +300,13 @@ def test_results(model: str, tmp_path):
300
300
  def test_labels_and_crops():
301
301
  """Test output from prediction args for saving YOLO detection labels and crops."""
302
302
  imgs = [SOURCE, ASSETS / "zidane.jpg"]
303
- results = YOLO(WEIGHTS_DIR / "yolo11n.pt")(imgs, imgsz=160, save_txt=True, save_crop=True)
303
+ results = YOLO(WEIGHTS_DIR / "yolo26n.pt")(imgs, imgsz=320, save_txt=True, save_crop=True)
304
304
  save_path = Path(results[0].save_dir)
305
305
  for r in results:
306
306
  im_name = Path(r.path).stem
307
307
  cls_idxs = r.boxes.cls.int().tolist()
308
- # Check correct detections
309
- assert cls_idxs == ([0, 7, 0, 0] if r.path.endswith("bus.jpg") else [0, 0, 0]) # bus.jpg and zidane.jpg classes
308
+ # Check that detections are made (at least 2 detections per image expected)
309
+ assert len(cls_idxs) >= 2, f"Expected at least 2 detections, got {len(cls_idxs)}"
310
310
  # Check label path
311
311
  labels = save_path / f"labels/{im_name}.txt"
312
312
  assert labels.exists()
@@ -360,7 +360,7 @@ def test_data_annotator(tmp_path):
360
360
 
361
361
  auto_annotate(
362
362
  ASSETS,
363
- det_model=WEIGHTS_DIR / "yolo11n.pt",
363
+ det_model=WEIGHTS_DIR / "yolo26n.pt",
364
364
  sam_model=WEIGHTS_DIR / "mobile_sam.pt",
365
365
  output_dir=tmp_path / "auto_annotate_labels",
366
366
  )
@@ -450,7 +450,7 @@ def test_utils_benchmarks():
450
450
  """Benchmark model performance using 'ProfileModels' from 'ultralytics.utils.benchmarks'."""
451
451
  from ultralytics.utils.benchmarks import ProfileModels
452
452
 
453
- ProfileModels(["yolo11n.yaml"], imgsz=32, min_time=1, num_timed_runs=3, num_warmup_runs=1).run()
453
+ ProfileModels(["yolo26n.yaml"], imgsz=32, min_time=1, num_timed_runs=3, num_warmup_runs=1).run()
454
454
 
455
455
 
456
456
  def test_utils_torchutils():
@@ -616,14 +616,14 @@ def test_classify_transforms_train(image, auto_augment, erasing, force_color_jit
616
616
  @pytest.mark.skipif(not ONLINE, reason="environment is offline")
617
617
  def test_model_tune():
618
618
  """Tune YOLO model for performance improvement."""
619
- YOLO("yolo11n-pose.pt").tune(data="coco8-pose.yaml", plots=False, imgsz=32, epochs=1, iterations=2, device="cpu")
620
- YOLO("yolo11n-cls.pt").tune(data="imagenet10", plots=False, imgsz=32, epochs=1, iterations=2, device="cpu")
619
+ YOLO("yolo26n-pose.pt").tune(data="coco8-pose.yaml", plots=False, imgsz=32, epochs=1, iterations=2, device="cpu")
620
+ YOLO("yolo26n-cls.pt").tune(data="imagenet10", plots=False, imgsz=32, epochs=1, iterations=2, device="cpu")
621
621
 
622
622
 
623
623
  def test_model_embeddings():
624
624
  """Test YOLO model embeddings extraction functionality."""
625
625
  model_detect = YOLO(MODEL)
626
- model_segment = YOLO(WEIGHTS_DIR / "yolo11n-seg.pt")
626
+ model_segment = YOLO(WEIGHTS_DIR / "yolo26n-seg.pt")
627
627
 
628
628
  for batch in [SOURCE], [SOURCE, SOURCE]: # test batch size 1 and 2
629
629
  assert len(model_detect.embed(source=batch, imgsz=32)) == len(batch)
@@ -744,7 +744,7 @@ def test_yolov10():
744
744
 
745
745
  def test_multichannel():
746
746
  """Test YOLO model multi-channel training, validation, and prediction functionality."""
747
- model = YOLO("yolo11n.pt")
747
+ model = YOLO("yolo26n.pt")
748
748
  model.train(data="coco8-multispectral.yaml", epochs=1, imgsz=32, close_mosaic=1, cache="disk")
749
749
  model.val(data="coco8-multispectral.yaml")
750
750
  im = np.zeros((32, 32, 10), dtype=np.uint8)
tests/test_solutions.py CHANGED
@@ -78,7 +78,7 @@ def process_video(solution, video_path: str, needs_frame_count: bool = False):
78
78
  solutions.ObjectCounter,
79
79
  False,
80
80
  DEMO_VIDEO,
81
- {"region": REGION, "model": "yolo11n-obb.pt", "show": SHOW},
81
+ {"region": REGION, "model": "yolo26n-obb.pt", "show": SHOW},
82
82
  ),
83
83
  (
84
84
  "Heatmap",
@@ -156,7 +156,7 @@ def process_video(solution, video_path: str, needs_frame_count: bool = False):
156
156
  solutions.InstanceSegmentation,
157
157
  False,
158
158
  DEMO_VIDEO,
159
- {"model": "yolo11n-seg.pt", "show": SHOW},
159
+ {"model": "yolo26n-seg.pt", "show": SHOW},
160
160
  ),
161
161
  ("VisionEye", solutions.VisionEye, False, DEMO_VIDEO, {"model": MODEL, "show": SHOW}),
162
162
  (
@@ -273,7 +273,7 @@ def test_config_update_method_with_invalid_argument():
273
273
  def test_plot_with_no_masks():
274
274
  """Test that instance segmentation handles cases with no masks."""
275
275
  im0 = np.zeros((640, 480, 3), dtype=np.uint8)
276
- isegment = solutions.InstanceSegmentation(model="yolo11n-seg.pt")
276
+ isegment = solutions.InstanceSegmentation(model="yolo26n-seg.pt")
277
277
  results = isegment(im0)
278
278
  assert results.plot_im is not None
279
279
 
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.253"
3
+ __version__ = "8.4.3"
4
4
 
5
5
  import importlib
6
6
  import os
@@ -62,11 +62,11 @@ TASK2DATA = {
62
62
  "obb": "dota8.yaml",
63
63
  }
64
64
  TASK2MODEL = {
65
- "detect": "yolo11n.pt",
66
- "segment": "yolo11n-seg.pt",
67
- "classify": "yolo11n-cls.pt",
68
- "pose": "yolo11n-pose.pt",
69
- "obb": "yolo11n-obb.pt",
65
+ "detect": "yolo26n.pt",
66
+ "segment": "yolo26n-seg.pt",
67
+ "classify": "yolo26n-cls.pt",
68
+ "pose": "yolo26n-pose.pt",
69
+ "obb": "yolo26n-obb.pt",
70
70
  }
71
71
  TASK2METRIC = {
72
72
  "detect": "metrics/mAP50-95(B)",
@@ -90,13 +90,13 @@ SOLUTIONS_HELP_MSG = f"""
90
90
  yolo solutions count source="path/to/video.mp4" region="[(20, 400), (1080, 400), (1080, 360), (20, 360)]"
91
91
 
92
92
  2. Call heatmap solution
93
- yolo solutions heatmap colormap=cv2.COLORMAP_PARULA model=yolo11n.pt
93
+ yolo solutions heatmap colormap=cv2.COLORMAP_PARULA model=yolo26n.pt
94
94
 
95
95
  3. Call queue management solution
96
- yolo solutions queue region="[(20, 400), (1080, 400), (1080, 360), (20, 360)]" model=yolo11n.pt
96
+ yolo solutions queue region="[(20, 400), (1080, 400), (1080, 360), (20, 360)]" model=yolo26n.pt
97
97
 
98
98
  4. Call workout monitoring solution for push-ups
99
- yolo solutions workout model=yolo11n-pose.pt kpts=[6, 8, 10]
99
+ yolo solutions workout model=yolo26n-pose.pt kpts=[6, 8, 10]
100
100
 
101
101
  5. Generate analytical graphs
102
102
  yolo solutions analytics analytics_type="pie"
@@ -118,16 +118,16 @@ CLI_HELP_MSG = f"""
118
118
  See all ARGS at https://docs.ultralytics.com/usage/cfg or with 'yolo cfg'
119
119
 
120
120
  1. Train a detection model for 10 epochs with an initial learning_rate of 0.01
121
- yolo train data=coco8.yaml model=yolo11n.pt epochs=10 lr0=0.01
121
+ yolo train data=coco8.yaml model=yolo26n.pt epochs=10 lr0=0.01
122
122
 
123
123
  2. Predict a YouTube video using a pretrained segmentation model at image size 320:
124
- yolo predict model=yolo11n-seg.pt source='https://youtu.be/LNwODJXcvt4' imgsz=320
124
+ yolo predict model=yolo26n-seg.pt source='https://youtu.be/LNwODJXcvt4' imgsz=320
125
125
 
126
126
  3. Validate a pretrained detection model at batch-size 1 and image size 640:
127
- yolo val model=yolo11n.pt data=coco8.yaml batch=1 imgsz=640
127
+ yolo val model=yolo26n.pt data=coco8.yaml batch=1 imgsz=640
128
128
 
129
- 4. Export a YOLO11n classification model to ONNX format at image size 224 by 128 (no TASK required)
130
- yolo export model=yolo11n-cls.pt format=onnx imgsz=224,128
129
+ 4. Export a YOLO26n classification model to ONNX format at image size 224 by 128 (no TASK required)
130
+ yolo export model=yolo26n-cls.pt format=onnx imgsz=224,128
131
131
 
132
132
  5. Ultralytics solutions usage
133
133
  yolo solutions count or any of {list(SOLUTION_MAP.keys())[1:-1]} source="path/to/video.mp4"
@@ -186,6 +186,7 @@ CFG_FRACTION_KEYS = frozenset(
186
186
  "conf",
187
187
  "iou",
188
188
  "fraction",
189
+ "multi_scale",
189
190
  }
190
191
  )
191
192
  CFG_INT_KEYS = frozenset(
@@ -237,7 +238,6 @@ CFG_BOOL_KEYS = frozenset(
237
238
  "simplify",
238
239
  "nms",
239
240
  "profile",
240
- "multi_scale",
241
241
  }
242
242
  )
243
243
 
@@ -305,8 +305,6 @@ def get_cfg(
305
305
  # Merge overrides
306
306
  if overrides:
307
307
  overrides = cfg2dict(overrides)
308
- if "save_dir" not in cfg:
309
- overrides.pop("save_dir", None) # special override keys to ignore
310
308
  check_dict_alignment(cfg, overrides)
311
309
  cfg = {**cfg, **overrides} # merge cfg and overrides dicts (prefer overrides)
312
310
 
@@ -494,7 +492,7 @@ def check_dict_alignment(
494
492
  base_keys, custom_keys = (frozenset(x.keys()) for x in (base, custom))
495
493
  # Allow 'augmentations' as a valid custom parameter for custom Albumentations transforms
496
494
  if allowed_custom_keys is None:
497
- allowed_custom_keys = {"augmentations"}
495
+ allowed_custom_keys = {"augmentations", "save_dir"}
498
496
  if mismatched := [k for k in custom_keys if k not in base_keys and k not in allowed_custom_keys]:
499
497
  from difflib import get_close_matches
500
498
 
@@ -606,7 +604,7 @@ def handle_yolo_settings(args: list[str]) -> None:
606
604
 
607
605
  Examples:
608
606
  >>> handle_yolo_settings(["reset"]) # Reset YOLO settings
609
- >>> handle_yolo_settings(["default_cfg_path=yolo11n.yaml"]) # Update a specific setting
607
+ >>> handle_yolo_settings(["default_cfg_path=yolo26n.yaml"]) # Update a specific setting
610
608
 
611
609
  Notes:
612
610
  - If no arguments are provided, the function will display the current settings.
@@ -651,7 +649,7 @@ def handle_yolo_solutions(args: list[str]) -> None:
651
649
  >>> handle_yolo_solutions(["analytics", "conf=0.25", "source=path/to/video.mp4"])
652
650
 
653
651
  Run inference with custom configuration, requires Streamlit version 1.29.0 or higher.
654
- >>> handle_yolo_solutions(["inference", "model=yolo11n.pt"])
652
+ >>> handle_yolo_solutions(["inference", "model=yolo26n.pt"])
655
653
 
656
654
  Notes:
657
655
  - Arguments can be provided in the format 'key=value' or as boolean flags
@@ -709,7 +707,7 @@ def handle_yolo_solutions(args: list[str]) -> None:
709
707
  str(ROOT / "solutions/streamlit_inference.py"),
710
708
  "--server.headless",
711
709
  "true",
712
- overrides.pop("model", "yolo11n.pt"),
710
+ overrides.pop("model", "yolo26n.pt"),
713
711
  ]
714
712
  )
715
713
  else:
@@ -760,9 +758,9 @@ def parse_key_value_pair(pair: str = "key=value") -> tuple:
760
758
  AssertionError: If the value is missing or empty.
761
759
 
762
760
  Examples:
763
- >>> key, value = parse_key_value_pair("model=yolo11n.pt")
761
+ >>> key, value = parse_key_value_pair("model=yolo26n.pt")
764
762
  >>> print(f"Key: {key}, Value: {value}")
765
- Key: model, Value: yolo11n.pt
763
+ Key: model, Value: yolo26n.pt
766
764
 
767
765
  >>> key, value = parse_key_value_pair("epochs=100")
768
766
  >>> print(f"Key: {key}, Value: {value}")
@@ -834,13 +832,13 @@ def entrypoint(debug: str = "") -> None:
834
832
 
835
833
  Examples:
836
834
  Train a detection model for 10 epochs with an initial learning_rate of 0.01:
837
- >>> entrypoint("train data=coco8.yaml model=yolo11n.pt epochs=10 lr0=0.01")
835
+ >>> entrypoint("train data=coco8.yaml model=yolo26n.pt epochs=10 lr0=0.01")
838
836
 
839
837
  Predict a YouTube video using a pretrained segmentation model at image size 320:
840
- >>> entrypoint("predict model=yolo11n-seg.pt source='https://youtu.be/LNwODJXcvt4' imgsz=320")
838
+ >>> entrypoint("predict model=yolo26n-seg.pt source='https://youtu.be/LNwODJXcvt4' imgsz=320")
841
839
 
842
840
  Validate a pretrained detection model at batch-size 1 and image size 640:
843
- >>> entrypoint("val model=yolo11n.pt data=coco8.yaml batch=1 imgsz=640")
841
+ >>> entrypoint("val model=yolo26n.pt data=coco8.yaml batch=1 imgsz=640")
844
842
 
845
843
  Notes:
846
844
  - If no arguments are passed, the function will display the usage help message.
@@ -935,7 +933,7 @@ def entrypoint(debug: str = "") -> None:
935
933
  # Model
936
934
  model = overrides.pop("model", DEFAULT_CFG.model)
937
935
  if model is None:
938
- model = "yolo11n.pt"
936
+ model = "yolo26n.pt"
939
937
  LOGGER.warning(f"'model' argument is missing. Using default 'model={model}'.")
940
938
  overrides["model"] = model
941
939
  stem = Path(model).stem.lower()
@@ -1024,5 +1022,5 @@ def copy_default_cfg() -> None:
1024
1022
 
1025
1023
 
1026
1024
  if __name__ == "__main__":
1027
- # Example: entrypoint(debug='yolo predict model=yolo11n.pt')
1025
+ # Example: entrypoint(debug='yolo predict model=yolo26n.pt')
1028
1026
  entrypoint(debug="")
@@ -36,7 +36,7 @@ amp: True # (bool) Automatic Mixed Precision (AMP) training; True runs AMP capab
36
36
  fraction: 1.0 # (float) fraction of training dataset to use (1.0 = all)
37
37
  profile: False # (bool) profile ONNX/TensorRT speeds during training for loggers
38
38
  freeze: # (int | list, optional) freeze first N layers (int) or specific layer indices (list)
39
- multi_scale: False # (bool) multiscale training by varying image size
39
+ multi_scale: 0.0 # (float) multiscale training by varying image size
40
40
  compile: False # (bool | str) enable torch.compile() backend='inductor'; True="default", False=off, or "default|reduce-overhead|max-autotune-no-cudagraphs"
41
41
 
42
42
  # Segmentation
@@ -103,6 +103,8 @@ cls: 0.5 # (float) classification loss gain
103
103
  dfl: 1.5 # (float) distribution focal loss gain
104
104
  pose: 12.0 # (float) pose loss gain (pose tasks)
105
105
  kobj: 1.0 # (float) keypoint objectness loss gain (pose tasks)
106
+ rle: 1.0 # (float) rle loss gain (pose tasks)
107
+ angle: 1.0 # (float) oriented angle loss gain (obb tasks)
106
108
  nbs: 64 # (int) nominal batch size used for loss normalization
107
109
  hsv_h: 0.015 # (float) HSV hue augmentation fraction
108
110
  hsv_s: 0.7 # (float) HSV saturation augmentation fraction
@@ -0,0 +1,33 @@
1
+ # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
2
+
3
+ # Ultralytics YOLO26-cls image classification model
4
+ # Model docs: https://docs.ultralytics.com/models/yolo26
5
+ # Task docs: https://docs.ultralytics.com/tasks/classify
6
+
7
+ # Parameters
8
+ nc: 1000 # number of classes
9
+ scales: # model compound scaling constants, i.e. 'model=yolo26n-cls.yaml' will call yolo26-cls.yaml with scale 'n'
10
+ # [depth, width, max_channels]
11
+ n: [0.50, 0.25, 1024] # summary: 86 layers, 2,812,104 parameters, 2,812,104 gradients, 0.5 GFLOPs
12
+ s: [0.50, 0.50, 1024] # summary: 86 layers, 6,724,008 parameters, 6,724,008 gradients, 1.6 GFLOPs
13
+ m: [0.50, 1.00, 512] # summary: 106 layers, 11,634,216 parameters, 11,634,216 gradients, 5.0 GFLOPs
14
+ l: [1.00, 1.00, 512] # summary: 176 layers, 14,115,624 parameters, 14,115,624 gradients, 6.2 GFLOPs
15
+ x: [1.00, 1.50, 512] # summary: 176 layers, 29,637,064 parameters, 29,637,064 gradients, 13.7 GFLOPs
16
+
17
+ # YOLO26n backbone
18
+ backbone:
19
+ # [from, repeats, module, args]
20
+ - [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
21
+ - [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
22
+ - [-1, 2, C3k2, [256, False, 0.25]]
23
+ - [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
24
+ - [-1, 2, C3k2, [512, False, 0.25]]
25
+ - [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
26
+ - [-1, 2, C3k2, [512, True]]
27
+ - [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
28
+ - [-1, 2, C3k2, [1024, True]]
29
+ - [-1, 2, C2PSA, [1024]] # 9
30
+
31
+ # YOLO26n head
32
+ head:
33
+ - [-1, 1, Classify, [nc]] # Classify
@@ -0,0 +1,52 @@
1
+ # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
2
+
3
+ # Ultralytics YOLO26-obb Oriented Bounding Boxes (OBB) model with P3/8 - P5/32 outputs
4
+ # Model docs: https://docs.ultralytics.com/models/yolo26
5
+ # Task docs: https://docs.ultralytics.com/tasks/obb
6
+
7
+ # Parameters
8
+ nc: 80 # number of classes
9
+ end2end: True # whether to use end-to-end mode
10
+ reg_max: 1 # DFL bins
11
+ scales: # model compound scaling constants, i.e. 'model=yolo26n-obb.yaml' will call yolo26-obb.yaml with scale 'n'
12
+ # [depth, width, max_channels]
13
+ n: [0.50, 0.25, 1024] # summary: 291 layers, 2,715,614 parameters, 2,715,614 gradients, 16.9 GFLOPs
14
+ s: [0.50, 0.50, 1024] # summary: 291 layers, 10,582,142 parameters, 10,582,142 gradients, 63.5 GFLOPs
15
+ m: [0.50, 1.00, 512] # summary: 311 layers, 23,593,918 parameters, 23,593,918 gradients, 211.9 GFLOPs
16
+ l: [1.00, 1.00, 512] # summary: 423 layers, 27,997,374 parameters, 27,997,374 gradients, 259.0 GFLOPs
17
+ x: [1.00, 1.50, 512] # summary: 423 layers, 62,811,678 parameters, 62,811,678 gradients, 578.9 GFLOPs
18
+
19
+ # YOLO26n backbone
20
+ backbone:
21
+ # [from, repeats, module, args]
22
+ - [-1, 1, Conv, [64, 3, 2]] # 0-P1/2
23
+ - [-1, 1, Conv, [128, 3, 2]] # 1-P2/4
24
+ - [-1, 2, C3k2, [256, False, 0.25]]
25
+ - [-1, 1, Conv, [256, 3, 2]] # 3-P3/8
26
+ - [-1, 2, C3k2, [512, False, 0.25]]
27
+ - [-1, 1, Conv, [512, 3, 2]] # 5-P4/16
28
+ - [-1, 2, C3k2, [512, True]]
29
+ - [-1, 1, Conv, [1024, 3, 2]] # 7-P5/32
30
+ - [-1, 2, C3k2, [1024, True]]
31
+ - [-1, 1, SPPF, [1024, 5, 3, True]] # 9
32
+ - [-1, 2, C2PSA, [1024]] # 10
33
+
34
+ # YOLO26n head
35
+ head:
36
+ - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
37
+ - [[-1, 6], 1, Concat, [1]] # cat backbone P4
38
+ - [-1, 2, C3k2, [512, True]] # 13
39
+
40
+ - [-1, 1, nn.Upsample, [None, 2, "nearest"]]
41
+ - [[-1, 4], 1, Concat, [1]] # cat backbone P3
42
+ - [-1, 2, C3k2, [256, True]] # 16 (P3/8-small)
43
+
44
+ - [-1, 1, Conv, [256, 3, 2]]
45
+ - [[-1, 13], 1, Concat, [1]] # cat head P4
46
+ - [-1, 2, C3k2, [512, True]] # 19 (P4/16-medium)
47
+
48
+ - [-1, 1, Conv, [512, 3, 2]]
49
+ - [[-1, 10], 1, Concat, [1]] # cat head P5
50
+ - [-1, 1, C3k2, [1024, True, 0.5, True]] # 22 (P5/32-large)
51
+
52
+ - [[16, 19, 22], 1, OBB26, [nc, 1]] # Detect(P3, P4, P5)