ultralytics 8.2.80__py3-none-any.whl → 8.2.81__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.

Potentially problematic release.


This version of ultralytics might be problematic. Click here for more details.

ultralytics/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ultralytics YOLO 🚀, AGPL-3.0 license
2
2
 
3
- __version__ = "8.2.80"
3
+ __version__ = "8.2.81"
4
4
 
5
5
  import os
6
6
 
@@ -992,8 +992,8 @@ class Boxes(BaseTensor):
992
992
  Convert bounding boxes from [x1, y1, x2, y2] format to [x, y, width, height] format.
993
993
 
994
994
  Returns:
995
- (torch.Tensor | numpy.ndarray): Boxes in [x, y, width, height] format, where x, y are the coordinates of
996
- the top-left corner of the bounding box, width, height are the dimensions of the bounding box and the
995
+ (torch.Tensor | numpy.ndarray): Boxes in [x_center, y_center, width, height] format, where x_center, y_center are the coordinates of
996
+ the center point of the bounding box, width, height are the dimensions of the bounding box and the
997
997
  shape of the returned tensor is (N, 4), where N is the number of boxes.
998
998
 
999
999
  Examples:
@@ -1,5 +1,6 @@
1
1
  # Ultralytics YOLO 🚀, AGPL-3.0 license
2
2
 
3
+ import shutil
3
4
  import threading
4
5
  import time
5
6
  from http import HTTPStatus
@@ -344,23 +345,34 @@ class HUBTrainingSession:
344
345
  map (float): Mean average precision of the model.
345
346
  final (bool): Indicates if the model is the final model after training.
346
347
  """
347
- if Path(weights).is_file():
348
- progress_total = Path(weights).stat().st_size if final else None # Only show progress if final
349
- self.request_queue(
350
- self.model.upload_model,
351
- epoch=epoch,
352
- weights=weights,
353
- is_best=is_best,
354
- map=map,
355
- final=final,
356
- retry=10,
357
- timeout=3600,
358
- thread=not final,
359
- progress_total=progress_total,
360
- stream_response=True,
361
- )
362
- else:
363
- LOGGER.warning(f"{PREFIX}WARNING ⚠️ Model upload issue. Missing model {weights}.")
348
+ weights = Path(weights)
349
+ if not weights.is_file():
350
+ last = weights.with_name("last" + weights.suffix)
351
+ if final and last.is_file():
352
+ LOGGER.warning(
353
+ f"{PREFIX} ARNING ⚠️ Model 'best.pt' not found, copying 'last.pt' to 'best.pt' and uploading. "
354
+ "This often happens when resuming training in transient environments like Google Colab. "
355
+ "For more reliable training, consider using Ultralytics HUB Cloud. "
356
+ "Learn more at https://docs.ultralytics.com/hub/cloud-training/."
357
+ )
358
+ shutil.copy(last, weights) # copy last.pt to best.pt
359
+ else:
360
+ LOGGER.warning(f"{PREFIX} WARNING ⚠️ Model upload issue. Missing model {weights}.")
361
+ return
362
+
363
+ self.request_queue(
364
+ self.model.upload_model,
365
+ epoch=epoch,
366
+ weights=str(weights),
367
+ is_best=is_best,
368
+ map=map,
369
+ final=final,
370
+ retry=10,
371
+ timeout=3600,
372
+ thread=not final,
373
+ progress_total=weights.stat().st_size if final else None, # only show progress if final
374
+ stream_response=True,
375
+ )
364
376
 
365
377
  @staticmethod
366
378
  def _show_upload_progress(content_length: int, response: requests.Response) -> None:
@@ -219,16 +219,19 @@ def plt_settings(rcparams=None, backend="Agg"):
219
219
  def wrapper(*args, **kwargs):
220
220
  """Sets rc parameters and backend, calls the original function, and restores the settings."""
221
221
  original_backend = plt.get_backend()
222
- if backend.lower() != original_backend.lower():
222
+ switch = backend.lower() != original_backend.lower()
223
+ if switch:
223
224
  plt.close("all") # auto-close()ing of figures upon backend switching is deprecated since 3.8
224
225
  plt.switch_backend(backend)
225
226
 
226
- with plt.rc_context(rcparams):
227
- result = func(*args, **kwargs)
228
-
229
- if backend != original_backend:
230
- plt.close("all")
231
- plt.switch_backend(original_backend)
227
+ # Plot with backend and always revert to original backend
228
+ try:
229
+ with plt.rc_context(rcparams):
230
+ result = func(*args, **kwargs)
231
+ finally:
232
+ if switch:
233
+ plt.close("all")
234
+ plt.switch_backend(original_backend)
232
235
  return result
233
236
 
234
237
  return wrapper
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ultralytics
3
- Version: 8.2.80
3
+ Version: 8.2.81
4
4
  Summary: Ultralytics YOLOv8 for SOTA object detection, multi-object tracking, instance segmentation, pose estimation and image classification.
5
5
  Author: Glenn Jocher, Ayush Chaurasia, Jing Qiu
6
6
  Maintainer: Glenn Jocher, Ayush Chaurasia, Jing Qiu
@@ -8,7 +8,7 @@ tests/test_exports.py,sha256=Uezf3OatpPHlo5qoPw-2kqkZxuMCF9L4XF2riD4vmII,8225
8
8
  tests/test_integrations.py,sha256=xglcfMPjfVh346PV8WTpk6tBxraCXEFJEQyyJMr5tyU,6064
9
9
  tests/test_python.py,sha256=SxBf5GNu7vXQP8QxTlSOzCzcQNN0PLA6EX8M33VDHsU,21927
10
10
  tests/test_solutions.py,sha256=EACnPXbeJe2aVTOKfqMk5jclKKCWCVgFEzjpR6y7Sh8,3304
11
- ultralytics/__init__.py,sha256=ch43rNL1kG7TcgIHol6N4_nsAy_9KPLu3h9NcvFLnKY,694
11
+ ultralytics/__init__.py,sha256=-jXQ4Rbvydd1EE5ShFfSxdZEo29lIC8dYZDGNcD25UQ,694
12
12
  ultralytics/assets/bus.jpg,sha256=wCAZxJecGR63Od3ZRERe9Aja1Weayrb9Ug751DS_vGM,137419
13
13
  ultralytics/assets/zidane.jpg,sha256=Ftc4aeMmen1O0A3o6GCDO9FlfBslLpTAw0gnetx7bts,50427
14
14
  ultralytics/cfg/__init__.py,sha256=oLjAiJXnxs1bsAB-nojG6evr0w1Ns9Ry5Js23ueiX9Y,33029
@@ -101,13 +101,13 @@ ultralytics/engine/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDT
101
101
  ultralytics/engine/exporter.py,sha256=EM35MOPWbIKE2ShJsPzdrEmrjzwZSp9gW-rO8GEFal0,58905
102
102
  ultralytics/engine/model.py,sha256=SunF9efCM9A5V6ykOaB5pSPmHz45mf5MNkIxr-Nlmc0,52191
103
103
  ultralytics/engine/predictor.py,sha256=W58kDCFH2AfoFzpGbos3k8zUEVsLunBuM8sc2B64rPY,17449
104
- ultralytics/engine/results.py,sha256=7KeqJ9GsFMpdSrEx5HWSgDSnX7p1MYa7qwn72QZwG8o,70512
104
+ ultralytics/engine/results.py,sha256=dyZcvSat_Vg6RooYl44fELjewqTsJ1-u65HPDe6oUxE,70537
105
105
  ultralytics/engine/trainer.py,sha256=KJ0FohkKsAOgkrU-Fawh1QwBuhalsuvf8NNEo5dkLSc,35591
106
106
  ultralytics/engine/tuner.py,sha256=iZrgMmXSDpfuDu4bdFRflmAsscys2-8W8qAGxSyOVJE,11844
107
107
  ultralytics/engine/validator.py,sha256=R0qND144EHTOedGDoqI60MxY9RigbynjvGrRYUjjPsU,14682
108
108
  ultralytics/hub/__init__.py,sha256=93bqI8x8-MfDYdKkQVduuocUiQj3WGnk1nIk0li08zA,5663
109
109
  ultralytics/hub/auth.py,sha256=FID58NE6fh7Op_B45QOpWBw1qoBN0ponL16uvyb2dZ8,5399
110
- ultralytics/hub/session.py,sha256=UF_aVwyxnbP-OzpzKXGGhi4i6KGWjjhoj5Qsn46dFpE,16257
110
+ ultralytics/hub/session.py,sha256=AZAhGkBs7e0K-QyDoMUOgo0ih6PK28XLK-S9ELBHY-Y,16865
111
111
  ultralytics/hub/utils.py,sha256=tXfM3QbXBcf4Y6StgHI1pktT4OM7Ic9eF3xiBFHGlhY,9721
112
112
  ultralytics/hub/google/__init__.py,sha256=qyvvpGP-4NAtrn7GLqfqxP_aWuRP1T0OvJYafWKvL2Q,7512
113
113
  ultralytics/models/__init__.py,sha256=TT9iLCL_n9Y80dcUq0Fo-p-GRZCSU2vrWXM3CoMwqqE,265
@@ -196,7 +196,7 @@ ultralytics/trackers/utils/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7J
196
196
  ultralytics/trackers/utils/gmc.py,sha256=ir7yjVYt1pyAMttOLRN8AAjvtn53fdnjXlf-sLA_5HQ,14557
197
197
  ultralytics/trackers/utils/kalman_filter.py,sha256=lxVWdR5NLXhAGcxd2hsiVsYsK3z3jhxZ4NbE-rMUgtE,21349
198
198
  ultralytics/trackers/utils/matching.py,sha256=hFul0NXkkpiTwtMpPm9lrKfLP-jPz6_u95W7PFlYUd4,7166
199
- ultralytics/utils/__init__.py,sha256=3quZsAsspHrk7IL2pN5LAocVL_dFriwhYIy8px2Re34,38931
199
+ ultralytics/utils/__init__.py,sha256=H6lUGhD05pA75W59dmkKxc4pKF97OeoKPOCy86FzUIw,39065
200
200
  ultralytics/utils/autobatch.py,sha256=POJb9f8dioI7lPGnCc7bdxt0ncftXZa0bvOkip-XoWk,3969
201
201
  ultralytics/utils/benchmarks.py,sha256=6tdNcBLATllWpmAMUC6TW7DiCx1VKHhnQN4vkoqN3sE,23866
202
202
  ultralytics/utils/checks.py,sha256=hBkhOinWRzhpA5SbY1v-wCMdFeOemORRlmKBXgwoHYo,28498
@@ -225,9 +225,9 @@ ultralytics/utils/callbacks/neptune.py,sha256=5Z3ua5YBTUS56FH8VQKQG1aaIo9fH8GEyz
225
225
  ultralytics/utils/callbacks/raytune.py,sha256=ODVYzy-CoM4Uge0zjkh3Hnh9nF2M0vhDrSenXnvcizw,705
226
226
  ultralytics/utils/callbacks/tensorboard.py,sha256=QEgOVhUqY9akOs5TJIwz1Rvn6l32xWLpOxlwEyWF0B8,4136
227
227
  ultralytics/utils/callbacks/wb.py,sha256=9-fjQIdLjr3b73DTE3rHO171KvbH1VweJ-bmbv-rqTw,6747
228
- ultralytics-8.2.80.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
229
- ultralytics-8.2.80.dist-info/METADATA,sha256=9pBpomsJ7LRC22S6XmsvsOEz7nOfn29b6ndnrhBdFRg,41264
230
- ultralytics-8.2.80.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
231
- ultralytics-8.2.80.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
232
- ultralytics-8.2.80.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
233
- ultralytics-8.2.80.dist-info/RECORD,,
228
+ ultralytics-8.2.81.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
229
+ ultralytics-8.2.81.dist-info/METADATA,sha256=LLWZkXC9FOHbB6nLxR9RXKz7NXiXyEE8zHxNStRBCws,41264
230
+ ultralytics-8.2.81.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
231
+ ultralytics-8.2.81.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
232
+ ultralytics-8.2.81.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
233
+ ultralytics-8.2.81.dist-info/RECORD,,