dgenerate-ultralytics-headless 8.3.160__py3-none-any.whl → 8.3.162__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 (67) hide show
  1. {dgenerate_ultralytics_headless-8.3.160.dist-info → dgenerate_ultralytics_headless-8.3.162.dist-info}/METADATA +9 -1
  2. {dgenerate_ultralytics_headless-8.3.160.dist-info → dgenerate_ultralytics_headless-8.3.162.dist-info}/RECORD +67 -67
  3. tests/conftest.py +2 -2
  4. tests/test_python.py +4 -3
  5. ultralytics/__init__.py +1 -1
  6. ultralytics/cfg/datasets/Argoverse.yaml +1 -1
  7. ultralytics/cfg/datasets/DOTAv1.5.yaml +1 -1
  8. ultralytics/cfg/datasets/DOTAv1.yaml +1 -1
  9. ultralytics/cfg/datasets/GlobalWheat2020.yaml +1 -1
  10. ultralytics/cfg/datasets/HomeObjects-3K.yaml +1 -1
  11. ultralytics/cfg/datasets/ImageNet.yaml +1 -1
  12. ultralytics/cfg/datasets/Objects365.yaml +1 -1
  13. ultralytics/cfg/datasets/SKU-110K.yaml +1 -1
  14. ultralytics/cfg/datasets/VOC.yaml +1 -1
  15. ultralytics/cfg/datasets/VisDrone.yaml +6 -3
  16. ultralytics/cfg/datasets/african-wildlife.yaml +1 -1
  17. ultralytics/cfg/datasets/brain-tumor.yaml +1 -1
  18. ultralytics/cfg/datasets/carparts-seg.yaml +1 -1
  19. ultralytics/cfg/datasets/coco-pose.yaml +1 -1
  20. ultralytics/cfg/datasets/coco.yaml +1 -1
  21. ultralytics/cfg/datasets/coco128-seg.yaml +1 -1
  22. ultralytics/cfg/datasets/coco128.yaml +1 -1
  23. ultralytics/cfg/datasets/coco8-grayscale.yaml +1 -1
  24. ultralytics/cfg/datasets/coco8-multispectral.yaml +1 -1
  25. ultralytics/cfg/datasets/coco8-pose.yaml +1 -1
  26. ultralytics/cfg/datasets/coco8-seg.yaml +1 -1
  27. ultralytics/cfg/datasets/coco8.yaml +1 -1
  28. ultralytics/cfg/datasets/crack-seg.yaml +1 -1
  29. ultralytics/cfg/datasets/dog-pose.yaml +1 -1
  30. ultralytics/cfg/datasets/dota8-multispectral.yaml +1 -1
  31. ultralytics/cfg/datasets/dota8.yaml +1 -1
  32. ultralytics/cfg/datasets/hand-keypoints.yaml +1 -1
  33. ultralytics/cfg/datasets/lvis.yaml +1 -1
  34. ultralytics/cfg/datasets/medical-pills.yaml +1 -1
  35. ultralytics/cfg/datasets/open-images-v7.yaml +1 -1
  36. ultralytics/cfg/datasets/package-seg.yaml +1 -1
  37. ultralytics/cfg/datasets/signature.yaml +1 -1
  38. ultralytics/cfg/datasets/tiger-pose.yaml +1 -1
  39. ultralytics/cfg/datasets/xView.yaml +1 -1
  40. ultralytics/data/augment.py +2 -0
  41. ultralytics/data/converter.py +5 -7
  42. ultralytics/data/dataset.py +1 -1
  43. ultralytics/data/split.py +1 -1
  44. ultralytics/data/split_dota.py +1 -1
  45. ultralytics/engine/exporter.py +15 -5
  46. ultralytics/engine/results.py +1 -1
  47. ultralytics/engine/tuner.py +2 -2
  48. ultralytics/models/nas/model.py +2 -1
  49. ultralytics/models/sam/modules/tiny_encoder.py +1 -1
  50. ultralytics/models/yolo/detect/val.py +1 -1
  51. ultralytics/models/yolo/world/train.py +1 -1
  52. ultralytics/models/yolo/world/train_world.py +17 -9
  53. ultralytics/models/yolo/yoloe/train.py +1 -1
  54. ultralytics/nn/autobackend.py +7 -1
  55. ultralytics/nn/tasks.py +4 -3
  56. ultralytics/solutions/similarity_search.py +11 -12
  57. ultralytics/solutions/solutions.py +53 -54
  58. ultralytics/utils/__init__.py +1 -2
  59. ultralytics/utils/checks.py +21 -0
  60. ultralytics/utils/metrics.py +10 -9
  61. ultralytics/utils/patches.py +1 -2
  62. ultralytics/utils/plotting.py +2 -2
  63. ultralytics/utils/torch_utils.py +2 -1
  64. {dgenerate_ultralytics_headless-8.3.160.dist-info → dgenerate_ultralytics_headless-8.3.162.dist-info}/WHEEL +0 -0
  65. {dgenerate_ultralytics_headless-8.3.160.dist-info → dgenerate_ultralytics_headless-8.3.162.dist-info}/entry_points.txt +0 -0
  66. {dgenerate_ultralytics_headless-8.3.160.dist-info → dgenerate_ultralytics_headless-8.3.162.dist-info}/licenses/LICENSE +0 -0
  67. {dgenerate_ultralytics_headless-8.3.160.dist-info → dgenerate_ultralytics_headless-8.3.162.dist-info}/top_level.txt +0 -0
@@ -25,7 +25,7 @@ import torch
25
25
  import tqdm
26
26
 
27
27
  from ultralytics import __version__
28
- from ultralytics.utils.patches import imread, imshow, imwrite, torch_load, torch_save # for patches
28
+ from ultralytics.utils.patches import imread, imshow, imwrite, torch_save # for patches
29
29
 
30
30
  # PyTorch Multi-GPU DDP Constants
31
31
  RANK = int(os.getenv("RANK", -1))
@@ -1593,7 +1593,6 @@ TESTS_RUNNING = is_pytest_running() or is_github_action_running()
1593
1593
  set_sentry()
1594
1594
 
1595
1595
  # Apply monkey patches
1596
- torch.load = torch_load
1597
1596
  torch.save = torch_save
1598
1597
  if WINDOWS:
1599
1598
  # Apply cv2 patches for non-ASCII and non-UTF characters in image paths
@@ -896,6 +896,27 @@ def is_rockchip():
896
896
  return False
897
897
 
898
898
 
899
+ def is_intel():
900
+ """
901
+ Check if the system has Intel hardware (CPU or GPU).
902
+
903
+ Returns:
904
+ (bool): True if Intel hardware is detected, False otherwise.
905
+ """
906
+ from ultralytics.utils.torch_utils import get_cpu_info
907
+
908
+ # Check CPU
909
+ if "intel" in get_cpu_info().lower():
910
+ return True
911
+
912
+ # Check GPU via xpu-smi
913
+ try:
914
+ result = subprocess.run(["xpu-smi", "discovery"], capture_output=True, text=True, timeout=5)
915
+ return "intel" in result.stdout.lower()
916
+ except (subprocess.TimeoutExpired, FileNotFoundError, subprocess.SubprocessError):
917
+ return False
918
+
919
+
899
920
  def is_sudo_available() -> bool:
900
921
  """
901
922
  Check if the sudo command is available in the environment.
@@ -488,7 +488,7 @@ class ConfusionMatrix(DataExportMixin):
488
488
  if ticklabels != "auto":
489
489
  ax.set_xticklabels(ticklabels, fontsize=tick_fontsize, rotation=90, ha="center")
490
490
  ax.set_yticklabels(ticklabels, fontsize=tick_fontsize)
491
- for s in ["left", "right", "bottom", "top", "outline"]:
491
+ for s in {"left", "right", "bottom", "top", "outline"}:
492
492
  if s != "outline":
493
493
  ax.spines[s].set_visible(False) # Confusion matrix plot don't have outline
494
494
  cbar.ax.spines[s].set_visible(False)
@@ -1006,6 +1006,7 @@ class DetMetrics(SimpleClass, DataExportMixin):
1006
1006
  save_dir=save_dir,
1007
1007
  names=self.names,
1008
1008
  on_plot=on_plot,
1009
+ prefix="Box",
1009
1010
  )[2:]
1010
1011
  self.box.nc = len(self.names)
1011
1012
  self.box.update(results)
@@ -1061,7 +1062,7 @@ class DetMetrics(SimpleClass, DataExportMixin):
1061
1062
  """Return dictionary of computed performance metrics and statistics."""
1062
1063
  return self.box.curves_results
1063
1064
 
1064
- def summary(self, normalize: bool = True, decimals: int = 5) -> List[Dict[str, Union[str, float]]]:
1065
+ def summary(self, normalize: bool = True, decimals: int = 5) -> List[Dict[str, Any]]:
1065
1066
  """
1066
1067
  Generate a summarized representation of per-class detection metrics as a list of dictionaries. Includes shared
1067
1068
  scalar metrics (mAP, mAP50, mAP75) alongside precision, recall, and F1-score for each class.
@@ -1071,7 +1072,7 @@ class DetMetrics(SimpleClass, DataExportMixin):
1071
1072
  decimals (int): Number of decimal places to round the metrics values to.
1072
1073
 
1073
1074
  Returns:
1074
- (List[Dict[str, Union[str, float]]]): A list of dictionaries, each representing one class with corresponding metric values.
1075
+ (List[Dict[str, Any]]): A list of dictionaries, each representing one class with corresponding metric values.
1075
1076
 
1076
1077
  Examples:
1077
1078
  >>> results = model.val(data="coco8.yaml")
@@ -1135,7 +1136,7 @@ class SegmentMetrics(DetMetrics):
1135
1136
  Returns:
1136
1137
  (Dict[str, np.ndarray]): Dictionary containing concatenated statistics arrays.
1137
1138
  """
1138
- stats = DetMetrics.process(self, on_plot=on_plot) # process box stats
1139
+ stats = DetMetrics.process(self, save_dir, plot, on_plot=on_plot) # process box stats
1139
1140
  results_mask = ap_per_class(
1140
1141
  stats["tp_m"],
1141
1142
  stats["conf"],
@@ -1194,7 +1195,7 @@ class SegmentMetrics(DetMetrics):
1194
1195
  """Return dictionary of computed performance metrics and statistics."""
1195
1196
  return DetMetrics.curves_results.fget(self) + self.seg.curves_results
1196
1197
 
1197
- def summary(self, normalize: bool = True, decimals: int = 5) -> List[Dict[str, Union[str, float]]]:
1198
+ def summary(self, normalize: bool = True, decimals: int = 5) -> List[Dict[str, Any]]:
1198
1199
  """
1199
1200
  Generate a summarized representation of per-class segmentation metrics as a list of dictionaries. Includes both
1200
1201
  box and mask scalar metrics (mAP, mAP50, mAP75) alongside precision, recall, and F1-score for each class.
@@ -1204,7 +1205,7 @@ class SegmentMetrics(DetMetrics):
1204
1205
  decimals (int): Number of decimal places to round the metrics values to.
1205
1206
 
1206
1207
  Returns:
1207
- (List[Dict[str, Union[str, float]]]): A list of dictionaries, each representing one class with corresponding metric values.
1208
+ (List[Dict[str, Any]]): A list of dictionaries, each representing one class with corresponding metric values.
1208
1209
 
1209
1210
  Examples:
1210
1211
  >>> results = model.val(data="coco8-seg.yaml")
@@ -1270,7 +1271,7 @@ class PoseMetrics(DetMetrics):
1270
1271
  Returns:
1271
1272
  (Dict[str, np.ndarray]): Dictionary containing concatenated statistics arrays.
1272
1273
  """
1273
- stats = DetMetrics.process(self, on_plot=on_plot) # process box stats
1274
+ stats = DetMetrics.process(self, save_dir, plot, on_plot=on_plot) # process box stats
1274
1275
  results_pose = ap_per_class(
1275
1276
  stats["tp_p"],
1276
1277
  stats["conf"],
@@ -1333,7 +1334,7 @@ class PoseMetrics(DetMetrics):
1333
1334
  """Return dictionary of computed performance metrics and statistics."""
1334
1335
  return DetMetrics.curves_results.fget(self) + self.pose.curves_results
1335
1336
 
1336
- def summary(self, normalize: bool = True, decimals: int = 5) -> List[Dict[str, Union[str, float]]]:
1337
+ def summary(self, normalize: bool = True, decimals: int = 5) -> List[Dict[str, Any]]:
1337
1338
  """
1338
1339
  Generate a summarized representation of per-class pose metrics as a list of dictionaries. Includes both box and
1339
1340
  pose scalar metrics (mAP, mAP50, mAP75) alongside precision, recall, and F1-score for each class.
@@ -1343,7 +1344,7 @@ class PoseMetrics(DetMetrics):
1343
1344
  decimals (int): Number of decimal places to round the metrics values to.
1344
1345
 
1345
1346
  Returns:
1346
- (List[Dict[str, Union[str, float]]]): A list of dictionaries, each representing one class with corresponding metric values.
1347
+ (List[Dict[str, Any]]): A list of dictionaries, each representing one class with corresponding metric values.
1347
1348
 
1348
1349
  Examples:
1349
1350
  >>> results = model.val(data="coco8-pose.yaml")
@@ -90,7 +90,6 @@ def imshow(winname: str, mat: np.ndarray) -> None:
90
90
 
91
91
 
92
92
  # PyTorch functions ----------------------------------------------------------------------------------------------------
93
- _torch_load = torch.load # copy to avoid recursion errors
94
93
  _torch_save = torch.save
95
94
 
96
95
 
@@ -116,7 +115,7 @@ def torch_load(*args, **kwargs):
116
115
  if TORCH_1_13 and "weights_only" not in kwargs:
117
116
  kwargs["weights_only"] = False
118
117
 
119
- return _torch_load(*args, **kwargs)
118
+ return torch.load(*args, **kwargs)
120
119
 
121
120
 
122
121
  def torch_save(*args, **kwargs):
@@ -610,8 +610,8 @@ def plot_labels(boxes, cls, names=(), save_dir=Path(""), on_plot=None):
610
610
  ax[3].hist2d(x["width"], x["height"], bins=50, cmap=subplot_3_4_color)
611
611
  ax[3].set_xlabel("width")
612
612
  ax[3].set_ylabel("height")
613
- for a in [0, 1, 2, 3]:
614
- for s in ["top", "right", "left", "bottom"]:
613
+ for a in {0, 1, 2, 3}:
614
+ for s in {"top", "right", "left", "bottom"}:
615
615
  ax[a].spines[s].set_visible(False)
616
616
 
617
617
  fname = save_dir / "labels.jpg"
@@ -30,6 +30,7 @@ from ultralytics.utils import (
30
30
  colorstr,
31
31
  )
32
32
  from ultralytics.utils.checks import check_version
33
+ from ultralytics.utils.patches import torch_load
33
34
 
34
35
  # Version checks (all default to version>=min_version)
35
36
  TORCH_1_9 = check_version(torch.__version__, "1.9.0")
@@ -724,7 +725,7 @@ def strip_optimizer(f: Union[str, Path] = "best.pt", s: str = "", updates: Dict[
724
725
  >>> strip_optimizer(f)
725
726
  """
726
727
  try:
727
- x = torch.load(f, map_location=torch.device("cpu"))
728
+ x = torch_load(f, map_location=torch.device("cpu"))
728
729
  assert isinstance(x, dict), "checkpoint is not a Python dictionary"
729
730
  assert "model" in x, "'model' missing from checkpoint"
730
731
  except Exception as e: