dgenerate-ultralytics-headless 8.3.189__py3-none-any.whl → 8.3.191__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 (111) hide show
  1. {dgenerate_ultralytics_headless-8.3.189.dist-info → dgenerate_ultralytics_headless-8.3.191.dist-info}/METADATA +1 -1
  2. {dgenerate_ultralytics_headless-8.3.189.dist-info → dgenerate_ultralytics_headless-8.3.191.dist-info}/RECORD +111 -109
  3. tests/test_cuda.py +6 -5
  4. tests/test_exports.py +1 -6
  5. tests/test_python.py +1 -4
  6. tests/test_solutions.py +1 -1
  7. ultralytics/__init__.py +1 -1
  8. ultralytics/cfg/__init__.py +16 -14
  9. ultralytics/cfg/datasets/VisDrone.yaml +4 -4
  10. ultralytics/data/annotator.py +6 -6
  11. ultralytics/data/augment.py +53 -51
  12. ultralytics/data/base.py +15 -13
  13. ultralytics/data/build.py +7 -4
  14. ultralytics/data/converter.py +9 -10
  15. ultralytics/data/dataset.py +24 -22
  16. ultralytics/data/loaders.py +13 -11
  17. ultralytics/data/split.py +4 -3
  18. ultralytics/data/split_dota.py +14 -12
  19. ultralytics/data/utils.py +31 -25
  20. ultralytics/engine/exporter.py +7 -4
  21. ultralytics/engine/model.py +16 -14
  22. ultralytics/engine/predictor.py +9 -7
  23. ultralytics/engine/results.py +59 -57
  24. ultralytics/engine/trainer.py +7 -0
  25. ultralytics/engine/tuner.py +4 -3
  26. ultralytics/engine/validator.py +3 -1
  27. ultralytics/hub/__init__.py +6 -2
  28. ultralytics/hub/auth.py +2 -2
  29. ultralytics/hub/google/__init__.py +9 -8
  30. ultralytics/hub/session.py +11 -11
  31. ultralytics/hub/utils.py +8 -9
  32. ultralytics/models/fastsam/model.py +8 -6
  33. ultralytics/models/nas/model.py +5 -3
  34. ultralytics/models/rtdetr/train.py +4 -3
  35. ultralytics/models/rtdetr/val.py +6 -4
  36. ultralytics/models/sam/amg.py +13 -10
  37. ultralytics/models/sam/model.py +3 -2
  38. ultralytics/models/sam/modules/blocks.py +21 -21
  39. ultralytics/models/sam/modules/decoders.py +11 -11
  40. ultralytics/models/sam/modules/encoders.py +25 -25
  41. ultralytics/models/sam/modules/memory_attention.py +9 -8
  42. ultralytics/models/sam/modules/sam.py +8 -10
  43. ultralytics/models/sam/modules/tiny_encoder.py +21 -20
  44. ultralytics/models/sam/modules/transformer.py +6 -5
  45. ultralytics/models/sam/modules/utils.py +7 -5
  46. ultralytics/models/sam/predict.py +32 -31
  47. ultralytics/models/utils/loss.py +29 -27
  48. ultralytics/models/utils/ops.py +10 -8
  49. ultralytics/models/yolo/classify/train.py +7 -5
  50. ultralytics/models/yolo/classify/val.py +10 -8
  51. ultralytics/models/yolo/detect/predict.py +3 -3
  52. ultralytics/models/yolo/detect/train.py +8 -6
  53. ultralytics/models/yolo/detect/val.py +23 -21
  54. ultralytics/models/yolo/model.py +14 -14
  55. ultralytics/models/yolo/obb/train.py +5 -3
  56. ultralytics/models/yolo/obb/val.py +13 -10
  57. ultralytics/models/yolo/pose/train.py +7 -5
  58. ultralytics/models/yolo/pose/val.py +11 -9
  59. ultralytics/models/yolo/segment/train.py +4 -5
  60. ultralytics/models/yolo/segment/val.py +12 -10
  61. ultralytics/models/yolo/world/train.py +9 -7
  62. ultralytics/models/yolo/yoloe/train.py +7 -6
  63. ultralytics/models/yolo/yoloe/val.py +10 -8
  64. ultralytics/nn/autobackend.py +40 -52
  65. ultralytics/nn/modules/__init__.py +3 -3
  66. ultralytics/nn/modules/block.py +12 -12
  67. ultralytics/nn/modules/conv.py +4 -3
  68. ultralytics/nn/modules/head.py +46 -38
  69. ultralytics/nn/modules/transformer.py +22 -21
  70. ultralytics/nn/tasks.py +2 -2
  71. ultralytics/nn/text_model.py +6 -5
  72. ultralytics/solutions/analytics.py +7 -5
  73. ultralytics/solutions/config.py +12 -10
  74. ultralytics/solutions/distance_calculation.py +3 -3
  75. ultralytics/solutions/heatmap.py +4 -2
  76. ultralytics/solutions/object_counter.py +5 -3
  77. ultralytics/solutions/parking_management.py +4 -2
  78. ultralytics/solutions/region_counter.py +7 -5
  79. ultralytics/solutions/similarity_search.py +5 -3
  80. ultralytics/solutions/solutions.py +38 -36
  81. ultralytics/solutions/streamlit_inference.py +8 -7
  82. ultralytics/trackers/bot_sort.py +11 -9
  83. ultralytics/trackers/byte_tracker.py +17 -15
  84. ultralytics/trackers/utils/gmc.py +4 -3
  85. ultralytics/utils/__init__.py +27 -77
  86. ultralytics/utils/autobatch.py +3 -2
  87. ultralytics/utils/autodevice.py +10 -10
  88. ultralytics/utils/benchmarks.py +11 -10
  89. ultralytics/utils/callbacks/comet.py +9 -9
  90. ultralytics/utils/callbacks/platform.py +2 -1
  91. ultralytics/utils/checks.py +20 -29
  92. ultralytics/utils/downloads.py +2 -2
  93. ultralytics/utils/export.py +12 -11
  94. ultralytics/utils/files.py +8 -7
  95. ultralytics/utils/git.py +139 -0
  96. ultralytics/utils/instance.py +8 -7
  97. ultralytics/utils/logger.py +7 -6
  98. ultralytics/utils/loss.py +15 -13
  99. ultralytics/utils/metrics.py +62 -62
  100. ultralytics/utils/nms.py +346 -0
  101. ultralytics/utils/ops.py +83 -251
  102. ultralytics/utils/patches.py +6 -4
  103. ultralytics/utils/plotting.py +18 -16
  104. ultralytics/utils/tal.py +1 -1
  105. ultralytics/utils/torch_utils.py +4 -2
  106. ultralytics/utils/tqdm.py +47 -33
  107. ultralytics/utils/triton.py +3 -2
  108. {dgenerate_ultralytics_headless-8.3.189.dist-info → dgenerate_ultralytics_headless-8.3.191.dist-info}/WHEEL +0 -0
  109. {dgenerate_ultralytics_headless-8.3.189.dist-info → dgenerate_ultralytics_headless-8.3.191.dist-info}/entry_points.txt +0 -0
  110. {dgenerate_ultralytics_headless-8.3.189.dist-info → dgenerate_ultralytics_headless-8.3.191.dist-info}/licenses/LICENSE +0 -0
  111. {dgenerate_ultralytics_headless-8.3.189.dist-info → dgenerate_ultralytics_headless-8.3.191.dist-info}/top_level.txt +0 -0
ultralytics/utils/tqdm.py CHANGED
@@ -139,10 +139,10 @@ class TQDM:
139
139
  self.initial = initial
140
140
 
141
141
  # Set bar format based on whether we have a total
142
- if self.total is not None:
143
- self.bar_format = bar_format or "{desc}: {percentage:3.0f}% {bar} {n_fmt}/{total_fmt} {rate_fmt} {elapsed}"
142
+ if self.total:
143
+ self.bar_format = bar_format or "{desc}: {percent:.0f}% {bar} {n}/{total} {rate} {elapsed}<{remaining}"
144
144
  else:
145
- self.bar_format = bar_format or "{desc}: {bar} {n_fmt} {rate_fmt} {elapsed}"
145
+ self.bar_format = bar_format or "{desc}: {bar} {n} {rate} {elapsed}"
146
146
 
147
147
  self.file = file or sys.stdout
148
148
 
@@ -155,7 +155,7 @@ class TQDM:
155
155
  self.closed = False
156
156
 
157
157
  # Display initial bar if we have total and not disabled
158
- if not self.disable and self.total is not None and not self.noninteractive:
158
+ if not self.disable and self.total and not self.noninteractive:
159
159
  self._display()
160
160
 
161
161
  def _format_rate(self, rate: float) -> str:
@@ -165,11 +165,18 @@ class TQDM:
165
165
 
166
166
  # For bytes with scaling, use binary units
167
167
  if self.unit in ("B", "bytes") and self.unit_scale:
168
- for threshold, unit in [(1024**3, "GB/s"), (1024**2, "MB/s"), (1024, "KB/s")]:
169
- if rate >= threshold:
170
- return f"{rate / threshold:.1f}{unit}"
171
- return f"{rate:.1f}B/s"
172
-
168
+ return next(
169
+ (
170
+ f"{rate / threshold:.1f}{unit}"
171
+ for threshold, unit in [
172
+ (1073741824, "GB/s"),
173
+ (1048576, "MB/s"),
174
+ (1024, "KB/s"),
175
+ ]
176
+ if rate >= threshold
177
+ ),
178
+ f"{rate:.1f}B/s",
179
+ )
173
180
  # For other scalable units, use decimal units
174
181
  if self.unit_scale and self.unit in ("it", "items", ""):
175
182
  for threshold, prefix in [(1000000, "M"), (1000, "K")]:
@@ -210,7 +217,7 @@ class TQDM:
210
217
  filled = int(frac * width)
211
218
  bar = "━" * filled + "─" * (width - filled)
212
219
  if filled < width and frac * width - filled > 0.5:
213
- bar = bar[:filled] + "" + bar[filled + 1 :]
220
+ bar = f"{bar[:filled]}{bar[filled + 1 :]}"
214
221
  return bar
215
222
 
216
223
  def _should_update(self, dt: float, dn: int) -> bool:
@@ -218,10 +225,7 @@ class TQDM:
218
225
  if self.noninteractive:
219
226
  return False
220
227
 
221
- if self.total is not None and self.n >= self.total:
222
- return True
223
-
224
- return dt >= self.mininterval
228
+ return True if self.total and self.n >= self.total else dt >= self.mininterval
225
229
 
226
230
  def _display(self, final: bool = False) -> None:
227
231
  """Display progress bar."""
@@ -256,30 +260,41 @@ class TQDM:
256
260
  self.last_print_t = current_time
257
261
  elapsed = current_time - self.start_t
258
262
 
263
+ # Calculate remaining time
264
+ remaining_str = ""
265
+ if self.total and 0 < self.n < self.total and rate > 0:
266
+ remaining_str = self._format_time((self.total - self.n) / rate)
267
+
259
268
  # Build progress components
260
- if self.total is not None:
261
- percentage = (self.n / self.total) * 100
269
+ if self.total:
270
+ percent = (self.n / self.total) * 100
262
271
  # For bytes with unit scaling, avoid repeating units: show "5.4/5.4MB" not "5.4MB/5.4MB"
263
- n_fmt = self._format_num(self.n)
264
- total_fmt = self._format_num(self.total)
272
+ n = self._format_num(self.n)
273
+ total = self._format_num(self.total)
265
274
  if self.unit_scale and self.unit in ("B", "bytes"):
266
- n_fmt = n_fmt.rstrip("KMGTPB") # Remove unit suffix from current
275
+ n = n.rstrip("KMGTPB") # Remove unit suffix from current
267
276
  else:
268
- percentage = 0
269
- n_fmt = self._format_num(self.n)
270
- total_fmt = "?"
277
+ percent = 0
278
+ n = self._format_num(self.n)
279
+ total = "?"
271
280
 
272
281
  elapsed_str = self._format_time(elapsed)
273
- rate_fmt = self._format_rate(rate) or (self._format_rate(self.n / elapsed) if elapsed > 0 else "")
282
+
283
+ # Use different format for completion
284
+ if self.total and self.n >= self.total:
285
+ format_str = self.bar_format.replace("<{remaining}", "")
286
+ else:
287
+ format_str = self.bar_format
274
288
 
275
289
  # Format progress string
276
- progress_str = self.bar_format.format(
290
+ progress_str = format_str.format(
277
291
  desc=self.desc,
278
- percentage=percentage,
292
+ percent=percent,
279
293
  bar=self._generate_bar(),
280
- n_fmt=n_fmt,
281
- total_fmt=total_fmt,
282
- rate_fmt=rate_fmt,
294
+ n=n,
295
+ total=total,
296
+ rate=self._format_rate(rate) or (self._format_rate(self.n / elapsed) if elapsed > 0 else ""),
297
+ remaining=remaining_str,
283
298
  elapsed=elapsed_str,
284
299
  unit=self.unit,
285
300
  )
@@ -395,12 +410,12 @@ if __name__ == "__main__":
395
410
  import time
396
411
 
397
412
  print("1. Basic progress bar with known total:")
398
- for i in TQDM(range(0), desc="Known total"):
413
+ for i in TQDM(range(3), desc="Known total"):
399
414
  time.sleep(0.05)
400
415
 
401
416
  print("\n2. Manual updates with known total:")
402
- pbar = TQDM(total=30, desc="Manual updates", unit="files")
403
- for i in range(30):
417
+ pbar = TQDM(total=300, desc="Manual updates", unit="files")
418
+ for i in range(300):
404
419
  time.sleep(0.03)
405
420
  pbar.update(1)
406
421
  if i % 10 == 9:
@@ -438,8 +453,7 @@ if __name__ == "__main__":
438
453
 
439
454
  def process_files():
440
455
  """Simulate processing files of unknown count."""
441
- files = [f"file_{i}.txt" for i in range(18)]
442
- return files
456
+ return [f"file_{i}.txt" for i in range(18)]
443
457
 
444
458
  pbar = TQDM(desc="Scanning files", unit="files")
445
459
  files = process_files()
@@ -1,6 +1,7 @@
1
1
  # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
2
2
 
3
- from typing import List
3
+ from __future__ import annotations
4
+
4
5
  from urllib.parse import urlsplit
5
6
 
6
7
  import numpy as np
@@ -86,7 +87,7 @@ class TritonRemoteModel:
86
87
  self.output_names = [x["name"] for x in config["output"]]
87
88
  self.metadata = eval(config.get("parameters", {}).get("metadata", {}).get("string_value", "None"))
88
89
 
89
- def __call__(self, *inputs: np.ndarray) -> List[np.ndarray]:
90
+ def __call__(self, *inputs: np.ndarray) -> list[np.ndarray]:
90
91
  """
91
92
  Call the model with the given inputs and return inference results.
92
93