dgenerate-ultralytics-headless 8.3.222__py3-none-any.whl → 8.3.225__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 (158) hide show
  1. {dgenerate_ultralytics_headless-8.3.222.dist-info → dgenerate_ultralytics_headless-8.3.225.dist-info}/METADATA +2 -2
  2. dgenerate_ultralytics_headless-8.3.225.dist-info/RECORD +286 -0
  3. tests/conftest.py +5 -8
  4. tests/test_cli.py +1 -8
  5. tests/test_python.py +1 -2
  6. ultralytics/__init__.py +1 -1
  7. ultralytics/cfg/__init__.py +34 -49
  8. ultralytics/cfg/datasets/ImageNet.yaml +1 -1
  9. ultralytics/cfg/datasets/kitti.yaml +27 -0
  10. ultralytics/cfg/datasets/lvis.yaml +5 -5
  11. ultralytics/cfg/datasets/open-images-v7.yaml +1 -1
  12. ultralytics/data/annotator.py +3 -4
  13. ultralytics/data/augment.py +244 -323
  14. ultralytics/data/base.py +12 -22
  15. ultralytics/data/build.py +47 -40
  16. ultralytics/data/converter.py +32 -42
  17. ultralytics/data/dataset.py +43 -71
  18. ultralytics/data/loaders.py +22 -34
  19. ultralytics/data/split.py +5 -6
  20. ultralytics/data/split_dota.py +8 -15
  21. ultralytics/data/utils.py +27 -36
  22. ultralytics/engine/exporter.py +49 -116
  23. ultralytics/engine/model.py +144 -180
  24. ultralytics/engine/predictor.py +18 -29
  25. ultralytics/engine/results.py +165 -231
  26. ultralytics/engine/trainer.py +11 -19
  27. ultralytics/engine/tuner.py +13 -23
  28. ultralytics/engine/validator.py +6 -10
  29. ultralytics/hub/__init__.py +7 -12
  30. ultralytics/hub/auth.py +6 -12
  31. ultralytics/hub/google/__init__.py +7 -10
  32. ultralytics/hub/session.py +15 -25
  33. ultralytics/hub/utils.py +3 -6
  34. ultralytics/models/fastsam/model.py +6 -8
  35. ultralytics/models/fastsam/predict.py +5 -10
  36. ultralytics/models/fastsam/utils.py +1 -2
  37. ultralytics/models/fastsam/val.py +2 -4
  38. ultralytics/models/nas/model.py +5 -8
  39. ultralytics/models/nas/predict.py +7 -9
  40. ultralytics/models/nas/val.py +1 -2
  41. ultralytics/models/rtdetr/model.py +5 -8
  42. ultralytics/models/rtdetr/predict.py +15 -18
  43. ultralytics/models/rtdetr/train.py +10 -13
  44. ultralytics/models/rtdetr/val.py +13 -20
  45. ultralytics/models/sam/amg.py +12 -18
  46. ultralytics/models/sam/build.py +6 -9
  47. ultralytics/models/sam/model.py +16 -23
  48. ultralytics/models/sam/modules/blocks.py +62 -84
  49. ultralytics/models/sam/modules/decoders.py +17 -24
  50. ultralytics/models/sam/modules/encoders.py +40 -56
  51. ultralytics/models/sam/modules/memory_attention.py +10 -16
  52. ultralytics/models/sam/modules/sam.py +41 -47
  53. ultralytics/models/sam/modules/tiny_encoder.py +64 -83
  54. ultralytics/models/sam/modules/transformer.py +17 -27
  55. ultralytics/models/sam/modules/utils.py +31 -42
  56. ultralytics/models/sam/predict.py +172 -209
  57. ultralytics/models/utils/loss.py +14 -26
  58. ultralytics/models/utils/ops.py +13 -17
  59. ultralytics/models/yolo/classify/predict.py +8 -11
  60. ultralytics/models/yolo/classify/train.py +8 -16
  61. ultralytics/models/yolo/classify/val.py +13 -20
  62. ultralytics/models/yolo/detect/predict.py +4 -8
  63. ultralytics/models/yolo/detect/train.py +11 -20
  64. ultralytics/models/yolo/detect/val.py +38 -48
  65. ultralytics/models/yolo/model.py +35 -47
  66. ultralytics/models/yolo/obb/predict.py +5 -8
  67. ultralytics/models/yolo/obb/train.py +11 -14
  68. ultralytics/models/yolo/obb/val.py +20 -28
  69. ultralytics/models/yolo/pose/predict.py +5 -8
  70. ultralytics/models/yolo/pose/train.py +4 -8
  71. ultralytics/models/yolo/pose/val.py +31 -39
  72. ultralytics/models/yolo/segment/predict.py +9 -14
  73. ultralytics/models/yolo/segment/train.py +3 -6
  74. ultralytics/models/yolo/segment/val.py +16 -26
  75. ultralytics/models/yolo/world/train.py +8 -14
  76. ultralytics/models/yolo/world/train_world.py +11 -16
  77. ultralytics/models/yolo/yoloe/predict.py +16 -23
  78. ultralytics/models/yolo/yoloe/train.py +30 -43
  79. ultralytics/models/yolo/yoloe/train_seg.py +5 -10
  80. ultralytics/models/yolo/yoloe/val.py +15 -20
  81. ultralytics/nn/autobackend.py +10 -18
  82. ultralytics/nn/modules/activation.py +4 -6
  83. ultralytics/nn/modules/block.py +99 -185
  84. ultralytics/nn/modules/conv.py +45 -90
  85. ultralytics/nn/modules/head.py +44 -98
  86. ultralytics/nn/modules/transformer.py +44 -76
  87. ultralytics/nn/modules/utils.py +14 -19
  88. ultralytics/nn/tasks.py +86 -146
  89. ultralytics/nn/text_model.py +25 -40
  90. ultralytics/solutions/ai_gym.py +10 -16
  91. ultralytics/solutions/analytics.py +7 -10
  92. ultralytics/solutions/config.py +4 -5
  93. ultralytics/solutions/distance_calculation.py +9 -12
  94. ultralytics/solutions/heatmap.py +7 -13
  95. ultralytics/solutions/instance_segmentation.py +5 -8
  96. ultralytics/solutions/object_blurrer.py +7 -10
  97. ultralytics/solutions/object_counter.py +8 -12
  98. ultralytics/solutions/object_cropper.py +5 -8
  99. ultralytics/solutions/parking_management.py +12 -14
  100. ultralytics/solutions/queue_management.py +4 -6
  101. ultralytics/solutions/region_counter.py +7 -10
  102. ultralytics/solutions/security_alarm.py +14 -19
  103. ultralytics/solutions/similarity_search.py +7 -12
  104. ultralytics/solutions/solutions.py +31 -53
  105. ultralytics/solutions/speed_estimation.py +6 -9
  106. ultralytics/solutions/streamlit_inference.py +2 -4
  107. ultralytics/solutions/trackzone.py +7 -10
  108. ultralytics/solutions/vision_eye.py +5 -8
  109. ultralytics/trackers/basetrack.py +2 -4
  110. ultralytics/trackers/bot_sort.py +6 -11
  111. ultralytics/trackers/byte_tracker.py +10 -15
  112. ultralytics/trackers/track.py +3 -6
  113. ultralytics/trackers/utils/gmc.py +6 -12
  114. ultralytics/trackers/utils/kalman_filter.py +35 -43
  115. ultralytics/trackers/utils/matching.py +6 -10
  116. ultralytics/utils/__init__.py +61 -100
  117. ultralytics/utils/autobatch.py +2 -4
  118. ultralytics/utils/autodevice.py +11 -13
  119. ultralytics/utils/benchmarks.py +25 -35
  120. ultralytics/utils/callbacks/base.py +8 -10
  121. ultralytics/utils/callbacks/clearml.py +2 -4
  122. ultralytics/utils/callbacks/comet.py +30 -44
  123. ultralytics/utils/callbacks/dvc.py +13 -18
  124. ultralytics/utils/callbacks/mlflow.py +4 -5
  125. ultralytics/utils/callbacks/neptune.py +4 -6
  126. ultralytics/utils/callbacks/raytune.py +3 -4
  127. ultralytics/utils/callbacks/tensorboard.py +4 -6
  128. ultralytics/utils/callbacks/wb.py +10 -13
  129. ultralytics/utils/checks.py +29 -56
  130. ultralytics/utils/cpu.py +1 -2
  131. ultralytics/utils/dist.py +8 -12
  132. ultralytics/utils/downloads.py +17 -27
  133. ultralytics/utils/errors.py +6 -8
  134. ultralytics/utils/events.py +2 -4
  135. ultralytics/utils/export/__init__.py +4 -239
  136. ultralytics/utils/export/engine.py +237 -0
  137. ultralytics/utils/export/imx.py +11 -17
  138. ultralytics/utils/export/tensorflow.py +217 -0
  139. ultralytics/utils/files.py +10 -15
  140. ultralytics/utils/git.py +5 -7
  141. ultralytics/utils/instance.py +30 -51
  142. ultralytics/utils/logger.py +11 -15
  143. ultralytics/utils/loss.py +8 -14
  144. ultralytics/utils/metrics.py +98 -138
  145. ultralytics/utils/nms.py +13 -16
  146. ultralytics/utils/ops.py +47 -74
  147. ultralytics/utils/patches.py +11 -18
  148. ultralytics/utils/plotting.py +29 -42
  149. ultralytics/utils/tal.py +25 -39
  150. ultralytics/utils/torch_utils.py +45 -73
  151. ultralytics/utils/tqdm.py +6 -8
  152. ultralytics/utils/triton.py +9 -12
  153. ultralytics/utils/tuner.py +1 -2
  154. dgenerate_ultralytics_headless-8.3.222.dist-info/RECORD +0 -283
  155. {dgenerate_ultralytics_headless-8.3.222.dist-info → dgenerate_ultralytics_headless-8.3.225.dist-info}/WHEEL +0 -0
  156. {dgenerate_ultralytics_headless-8.3.222.dist-info → dgenerate_ultralytics_headless-8.3.225.dist-info}/entry_points.txt +0 -0
  157. {dgenerate_ultralytics_headless-8.3.222.dist-info → dgenerate_ultralytics_headless-8.3.225.dist-info}/licenses/LICENSE +0 -0
  158. {dgenerate_ultralytics_headless-8.3.222.dist-info → dgenerate_ultralytics_headless-8.3.225.dist-info}/top_level.txt +0 -0
@@ -68,11 +68,10 @@ Example:
68
68
 
69
69
 
70
70
  class BasePredictor:
71
- """
72
- A base class for creating predictors.
71
+ """A base class for creating predictors.
73
72
 
74
- This class provides the foundation for prediction functionality, handling model setup, inference,
75
- and result processing across various input sources.
73
+ This class provides the foundation for prediction functionality, handling model setup, inference, and result
74
+ processing across various input sources.
76
75
 
77
76
  Attributes:
78
77
  args (SimpleNamespace): Configuration for the predictor.
@@ -115,8 +114,7 @@ class BasePredictor:
115
114
  overrides: dict[str, Any] | None = None,
116
115
  _callbacks: dict[str, list[callable]] | None = None,
117
116
  ):
118
- """
119
- Initialize the BasePredictor class.
117
+ """Initialize the BasePredictor class.
120
118
 
121
119
  Args:
122
120
  cfg (str | dict): Path to a configuration file or a configuration dictionary.
@@ -151,8 +149,7 @@ class BasePredictor:
151
149
  callbacks.add_integration_callbacks(self)
152
150
 
153
151
  def preprocess(self, im: torch.Tensor | list[np.ndarray]) -> torch.Tensor:
154
- """
155
- Prepare input image before inference.
152
+ """Prepare input image before inference.
156
153
 
157
154
  Args:
158
155
  im (torch.Tensor | list[np.ndarray]): Images of shape (N, 3, H, W) for tensor, [(H, W, 3) x N] for list.
@@ -185,8 +182,7 @@ class BasePredictor:
185
182
  return self.model(im, augment=self.args.augment, visualize=visualize, embed=self.args.embed, *args, **kwargs)
186
183
 
187
184
  def pre_transform(self, im: list[np.ndarray]) -> list[np.ndarray]:
188
- """
189
- Pre-transform input image before inference.
185
+ """Pre-transform input image before inference.
190
186
 
191
187
  Args:
192
188
  im (list[np.ndarray]): List of images with shape [(H, W, 3) x N].
@@ -209,8 +205,7 @@ class BasePredictor:
209
205
  return preds
210
206
 
211
207
  def __call__(self, source=None, model=None, stream: bool = False, *args, **kwargs):
212
- """
213
- Perform inference on an image or stream.
208
+ """Perform inference on an image or stream.
214
209
 
215
210
  Args:
216
211
  source (str | Path | list[str] | list[Path] | list[np.ndarray] | np.ndarray | torch.Tensor, optional):
@@ -230,11 +225,10 @@ class BasePredictor:
230
225
  return list(self.stream_inference(source, model, *args, **kwargs)) # merge list of Result into one
231
226
 
232
227
  def predict_cli(self, source=None, model=None):
233
- """
234
- Method used for Command Line Interface (CLI) prediction.
228
+ """Method used for Command Line Interface (CLI) prediction.
235
229
 
236
- This function is designed to run predictions using the CLI. It sets up the source and model, then processes
237
- the inputs in a streaming manner. This method ensures that no outputs accumulate in memory by consuming the
230
+ This function is designed to run predictions using the CLI. It sets up the source and model, then processes the
231
+ inputs in a streaming manner. This method ensures that no outputs accumulate in memory by consuming the
238
232
  generator without storing results.
239
233
 
240
234
  Args:
@@ -242,7 +236,7 @@ class BasePredictor:
242
236
  Source for inference.
243
237
  model (str | Path | torch.nn.Module, optional): Model for inference.
244
238
 
245
- Note:
239
+ Notes:
246
240
  Do not modify this function or remove the generator. The generator ensures that no outputs are
247
241
  accumulated in memory, which is critical for preventing memory issues during long-running predictions.
248
242
  """
@@ -251,12 +245,11 @@ class BasePredictor:
251
245
  pass
252
246
 
253
247
  def setup_source(self, source):
254
- """
255
- Set up source and inference mode.
248
+ """Set up source and inference mode.
256
249
 
257
250
  Args:
258
- source (str | Path | list[str] | list[Path] | list[np.ndarray] | np.ndarray | torch.Tensor):
259
- Source for inference.
251
+ source (str | Path | list[str] | list[Path] | list[np.ndarray] | np.ndarray | torch.Tensor): Source for
252
+ inference.
260
253
  """
261
254
  self.imgsz = check_imgsz(self.args.imgsz, stride=self.model.stride, min_dim=2) # check image size
262
255
  self.dataset = load_inference_source(
@@ -282,8 +275,7 @@ class BasePredictor:
282
275
 
283
276
  @smart_inference_mode()
284
277
  def stream_inference(self, source=None, model=None, *args, **kwargs):
285
- """
286
- Stream real-time inference on camera feed and save results to file.
278
+ """Stream real-time inference on camera feed and save results to file.
287
279
 
288
280
  Args:
289
281
  source (str | Path | list[str] | list[Path] | list[np.ndarray] | np.ndarray | torch.Tensor, optional):
@@ -388,8 +380,7 @@ class BasePredictor:
388
380
  self.run_callbacks("on_predict_end")
389
381
 
390
382
  def setup_model(self, model, verbose: bool = True):
391
- """
392
- Initialize YOLO model with given parameters and set it to evaluation mode.
383
+ """Initialize YOLO model with given parameters and set it to evaluation mode.
393
384
 
394
385
  Args:
395
386
  model (str | Path | torch.nn.Module, optional): Model to load or use.
@@ -413,8 +404,7 @@ class BasePredictor:
413
404
  self.model = attempt_compile(self.model, device=self.device, mode=self.args.compile)
414
405
 
415
406
  def write_results(self, i: int, p: Path, im: torch.Tensor, s: list[str]) -> str:
416
- """
417
- Write inference results to a file or directory.
407
+ """Write inference results to a file or directory.
418
408
 
419
409
  Args:
420
410
  i (int): Index of the current image in the batch.
@@ -464,8 +454,7 @@ class BasePredictor:
464
454
  return string
465
455
 
466
456
  def save_predicted_images(self, save_path: Path, frame: int = 0):
467
- """
468
- Save video predictions as mp4 or images as jpg at specified path.
457
+ """Save video predictions as mp4 or images as jpg at specified path.
469
458
 
470
459
  Args:
471
460
  save_path (Path): Path to save the results.