ultralytics 8.0.83__py3-none-any.whl → 8.0.84__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.0.83'
3
+ __version__ = '8.0.84'
4
4
 
5
5
  from ultralytics.hub import start
6
6
  from ultralytics.yolo.engine.model import YOLO
@@ -120,11 +120,14 @@ class BaseDataset(Dataset):
120
120
  cls = self.labels[i]['cls']
121
121
  bboxes = self.labels[i]['bboxes']
122
122
  segments = self.labels[i]['segments']
123
+ keypoints = self.labels[i]['keypoints']
123
124
  j = (cls == include_class_array).any(1)
124
125
  self.labels[i]['cls'] = cls[j]
125
126
  self.labels[i]['bboxes'] = bboxes[j]
126
127
  if segments:
127
128
  self.labels[i]['segments'] = [segments[si] for si, idx in enumerate(j) if idx]
129
+ if keypoints is not None:
130
+ self.labels[i]['keypoints'] = keypoints[j]
128
131
  if self.single_cls:
129
132
  self.labels[i]['cls'][:, 0] = 0
130
133
 
@@ -97,11 +97,6 @@ class Results(SimpleClass):
97
97
  self.path = path
98
98
  self._keys = ('boxes', 'masks', 'probs', 'keypoints')
99
99
 
100
- def pandas(self):
101
- """Convert the results to a pandas DataFrame."""
102
- pass
103
- # TODO masks.pandas + boxes.pandas + cls.pandas
104
-
105
100
  def __getitem__(self, idx):
106
101
  """Return a Results object for the specified index."""
107
102
  r = self.new()
@@ -315,6 +310,35 @@ class Results(SimpleClass):
315
310
  file=save_dir / self.names[int(d.cls)] / f'{file_name.stem}.jpg',
316
311
  BGR=True)
317
312
 
313
+ def pandas(self):
314
+ """Convert the object to a pandas DataFrame (not yet implemented)."""
315
+ LOGGER.warning("WARNING ⚠️ 'Results.pandas' method is not yet implemented.")
316
+
317
+ def tojson(self, normalize=False):
318
+ """Convert the object to JSON format."""
319
+ import json
320
+
321
+ # Create list of detection dictionaries
322
+ results = []
323
+ data = self.boxes.data.cpu().tolist()
324
+ h, w = self.orig_shape if normalize else (1, 1)
325
+ for i, row in enumerate(data):
326
+ box = {'x1': row[0] / w, 'y1': row[1] / h, 'x2': row[2] / w, 'y2': row[3] / h}
327
+ conf = row[4]
328
+ id = int(row[5])
329
+ name = self.names[id]
330
+ result = {'name': name, 'class': id, 'confidence': conf, 'box': box}
331
+ if self.masks:
332
+ x, y = self.masks.xy[i][:, 0], self.masks.xy[i][:, 1] # numpy array
333
+ result['segments'] = {'x': (x / w).tolist(), 'y': (y / h).tolist()}
334
+ if self.keypoints is not None:
335
+ x, y, visible = self.keypoints[i].cpu().unbind(dim=1) # torch Tensor
336
+ result['keypoints'] = {'x': (x / w).tolist(), 'y': (y / h).tolist(), 'visible': visible.tolist()}
337
+ results.append(result)
338
+
339
+ # Convert detections to JSON
340
+ return json.dumps(results, indent=2)
341
+
318
342
 
319
343
  class Boxes(BaseTensor):
320
344
  """
@@ -397,10 +421,6 @@ class Boxes(BaseTensor):
397
421
  """Return the boxes in xywh format normalized by original image size."""
398
422
  return self.xywh / self.orig_shape[[1, 0, 1, 0]]
399
423
 
400
- def pandas(self):
401
- """Convert the object to a pandas DataFrame (not yet implemented)."""
402
- LOGGER.info('results.pandas() method not yet implemented')
403
-
404
424
  @property
405
425
  def boxes(self):
406
426
  """Return the raw bboxes tensor (deprecated)."""
@@ -466,3 +486,7 @@ class Masks(BaseTensor):
466
486
  """Return the raw masks tensor (deprecated)."""
467
487
  LOGGER.warning("WARNING ⚠️ 'Masks.masks' is deprecated. Use 'Masks.data' instead.")
468
488
  return self.data
489
+
490
+ def pandas(self):
491
+ """Convert the object to a pandas DataFrame (not yet implemented)."""
492
+ LOGGER.warning("WARNING ⚠️ 'Masks.pandas' method is not yet implemented.")
@@ -34,7 +34,7 @@ class Bboxes:
34
34
  """Now only numpy is supported."""
35
35
 
36
36
  def __init__(self, bboxes, format='xyxy') -> None:
37
- assert format in _formats
37
+ assert format in _formats, f'Invalid bounding box format: {format}, format must be one of {_formats}'
38
38
  bboxes = bboxes[None, :] if bboxes.ndim == 1 else bboxes
39
39
  assert bboxes.ndim == 2
40
40
  assert bboxes.shape[1] == 4
@@ -66,7 +66,7 @@ class Bboxes:
66
66
 
67
67
  def convert(self, format):
68
68
  """Converts bounding box format from one type to another."""
69
- assert format in _formats
69
+ assert format in _formats, f'Invalid bounding box format: {format}, format must be one of {_formats}'
70
70
  if self.format == format:
71
71
  return
72
72
  elif self.format == 'xyxy':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ultralytics
3
- Version: 8.0.83
3
+ Version: 8.0.84
4
4
  Summary: Ultralytics YOLOv8
5
5
  Home-page: https://github.com/ultralytics/ultralytics
6
6
  Author: Ultralytics
@@ -78,7 +78,9 @@ Requires-Dist: tensorflowjs ; extra == 'export'
78
78
  </div>
79
79
  <br>
80
80
 
81
- [Ultralytics YOLOv8](https://github.com/ultralytics/ultralytics), developed by [Ultralytics](https://ultralytics.com), is a cutting-edge, state-of-the-art (SOTA) model that builds upon the success of previous YOLO versions and introduces new features and improvements to further boost performance and flexibility. YOLOv8 is designed to be fast, accurate, and easy to use, making it an excellent choice for a wide range of object detection, image segmentation and image classification tasks.
81
+ [Ultralytics](https://ultralytics.com) [YOLOv8](https://github.com/ultralytics/ultralytics) is a cutting-edge, state-of-the-art (SOTA) model that builds upon the success of previous YOLO versions and introduces new features and improvements to further boost performance and flexibility. YOLOv8 is designed to be fast, accurate, and easy to use, making it an excellent choice for a wide range of object detection and tracking, instance segmentation, image classification and pose estimation tasks.
82
+
83
+ We hope that the resources here will help you get the most out of YOLOv8. Please browse the YOLOv8 <a href="https://docs.ultralytics.com/">Docs</a> for details, raise an issue on <a href="https://github.com/ultralytics/ultralytics">GitHub</a> for support, and join our <a href="https://discord.gg/n6cFeSPZdD">Discord</a> community for questions and discussions!
82
84
 
83
85
  To request an Enterprise License please complete the form at [Ultralytics Licensing](https://ultralytics.com/license).
84
86
 
@@ -102,6 +104,9 @@ To request an Enterprise License please complete the form at [Ultralytics Licens
102
104
  <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="" />
103
105
  <a href="https://www.instagram.com/ultralytics/" style="text-decoration:none;">
104
106
  <img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-instagram.png" width="2%" alt="" /></a>
107
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="2%" alt="" />
108
+ <a href="https://discord.gg/n6cFeSPZdD" style="text-decoration:none;">
109
+ <img src="https://github.com/ultralytics/assets/blob/main/social/logo-social-discord.png" width="2%" alt="" /></a>
105
110
  </div>
106
111
  </div>
107
112
 
@@ -290,7 +295,7 @@ YOLOv8 is available under two different licenses:
290
295
 
291
296
  ## <div align="center">Contact</div>
292
297
 
293
- For YOLOv8 bug reports and feature requests please visit [GitHub Issues](https://github.com/ultralytics/ultralytics/issues) or the [Ultralytics Community Forum](https://community.ultralytics.com/).
298
+ For YOLOv8 bug reports and feature requests please visit [GitHub Issues](https://github.com/ultralytics/ultralytics/issues), and join our [Discord](https://discord.gg/n6cFeSPZdD) community for questions and discussions!
294
299
 
295
300
  <br>
296
301
  <div align="center">
@@ -311,4 +316,7 @@ For YOLOv8 bug reports and feature requests please visit [GitHub Issues](https:/
311
316
  <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="" />
312
317
  <a href="https://www.instagram.com/ultralytics/" style="text-decoration:none;">
313
318
  <img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-instagram.png" width="3%" alt="" /></a>
319
+ <img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="" />
320
+ <a href="https://discord.gg/n6cFeSPZdD" style="text-decoration:none;">
321
+ <img src="https://github.com/ultralytics/assets/blob/main/social/logo-social-discord.png" width="3%" alt="" /></a>
314
322
  </div>
@@ -1,4 +1,4 @@
1
- ultralytics/__init__.py,sha256=QqRGjcda1d_sbqrdTTSd-yvyaDVG6U0x-tMZtlFtoso,287
1
+ ultralytics/__init__.py,sha256=yFl5HzLsNajIugI41L5fKqAPHPCHjQJPjkhCa3vGb1g,287
2
2
  ultralytics/assets/bus.jpg,sha256=wCAZxJecGR63Od3ZRERe9Aja1Weayrb9Ug751DS_vGM,137419
3
3
  ultralytics/assets/zidane.jpg,sha256=Ftc4aeMmen1O0A3o6GCDO9FlfBslLpTAw0gnetx7bts,50427
4
4
  ultralytics/datasets/Argoverse.yaml,sha256=Q6hKRtI52JOYt4qmjkeo192mmgSkuCdOnfiUTxtBy5A,2751
@@ -54,7 +54,7 @@ ultralytics/yolo/cfg/__init__.py,sha256=ChytO9nlSVzGq9OFX2aG0YcwFKEG-F8sBEzYm3ET
54
54
  ultralytics/yolo/cfg/default.yaml,sha256=xDD9Pq8oyS2D5E0vbPapophm6arUA0BfFz-Jf0Y9jTU,6238
55
55
  ultralytics/yolo/data/__init__.py,sha256=vxjtAx1Y5fPnnJNJsMIHFmwZ0nnmS_R9iNaR1dS57jw,484
56
56
  ultralytics/yolo/data/augment.py,sha256=mc10LnwfBqh-ZtWFSd5Kz1VBC4CDFIwqwz492c0XV0I,33512
57
- ultralytics/yolo/data/base.py,sha256=9MPybWnbU4wjoa4KBM3ilDE6QkNmhxTxKxhtmKMk9y0,11548
57
+ ultralytics/yolo/data/base.py,sha256=5L5O-3SoKnWdZHapud9zm9G4BxheJ_PXCbkfZsWbzBA,11709
58
58
  ultralytics/yolo/data/build.py,sha256=n8daI3j7QwAkybKEGeAXvL0Hx44Q67PWL7XiU-GgxvQ,9166
59
59
  ultralytics/yolo/data/dataset.py,sha256=6mRxLJKemncS0Guuv5SBkwJB2iPjP8GHmvMxyE3xn8Y,13392
60
60
  ultralytics/yolo/data/dataset_wrappers.py,sha256=1IheItG9kjZP4U1sXbu69lYyt1bIgcyPf-whj_Nyzrw,1816
@@ -67,7 +67,7 @@ ultralytics/yolo/engine/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
67
67
  ultralytics/yolo/engine/exporter.py,sha256=huzPGXx4dV6_s1Pe9fbqJh6q0A1GZFRjS1--5VcQlRU,40265
68
68
  ultralytics/yolo/engine/model.py,sha256=oIfJA6sZ7UH1ZEpMQ-IqHXcS-3a_f9qeBR4ymRIHstI,21939
69
69
  ultralytics/yolo/engine/predictor.py,sha256=ez0Fyrpu2hAw-CgoYcolXiSmSa9hO1lLAdEymWZSbqE,15529
70
- ultralytics/yolo/engine/results.py,sha256=ak6VRV9Fy__VmSz70R36eyyrOYltFZ6vRbky_H2pPd0,19125
70
+ ultralytics/yolo/engine/results.py,sha256=N2BKrCzCOgW8MFdnlvN_FvZE2-rbCGEqjPnSelpvFtk,20324
71
71
  ultralytics/yolo/engine/trainer.py,sha256=W-NNeN_bflCkelrdNhYojIejWWEdh3FU1C5S-Ir_In0,31004
72
72
  ultralytics/yolo/engine/validator.py,sha256=-kHek5qxXmcB6oLliTN3K7WwZTQQ2108xbhBDKx3jrE,11305
73
73
  ultralytics/yolo/utils/__init__.py,sha256=iKPMM22JSjCwVNR_nJDoEOf8oz2s_DEzfS3VfirmkVg,26962
@@ -78,7 +78,7 @@ ultralytics/yolo/utils/dist.py,sha256=TGI8LHq7tedBnHVK8jgm50IvgUIsAtx7Zca8K2c1jN
78
78
  ultralytics/yolo/utils/downloads.py,sha256=ggUlGG-Dl1y-e_KY83_i1j-23fXK48I5yv1MeZ_F_4s,11431
79
79
  ultralytics/yolo/utils/errors.py,sha256=u8NUGZbWVrr4O3ez6UXnabNb_zRwJUPJqDOUSpmX3-k,317
80
80
  ultralytics/yolo/utils/files.py,sha256=kZP5kykAUwveBinJvhvLSSWkU9vGM7EAoC0EXpaxbIE,3316
81
- ultralytics/yolo/utils/instance.py,sha256=snP9ZePywlWo5wT7T8uwM7a0dMvp6ivyuhC_c_OkSMI,14024
81
+ ultralytics/yolo/utils/instance.py,sha256=S2vvc1vjNHHshFf4d3kwl8DvKsRo6ck38wDcf7eQYuI,14176
82
82
  ultralytics/yolo/utils/loss.py,sha256=Ejdi8DXCDK57UG6FsM4mAIh05d7U9qzx_7bmhGoddiA,3195
83
83
  ultralytics/yolo/utils/metrics.py,sha256=qMh9E9K4WzFJQdkosWCqCXHg0XirusDquWFienzOm2s,41829
84
84
  ultralytics/yolo/utils/ops.py,sha256=UQDe4TCR56NsSPEeeW1-ZJKYMOrtadClPxP_XXWiNFM,28191
@@ -113,9 +113,9 @@ ultralytics/yolo/v8/segment/__init__.py,sha256=TOdf3ju-D5hSi-PYMpETFmv-wyhIRKGuj
113
113
  ultralytics/yolo/v8/segment/predict.py,sha256=u0UhoeSQIpygbHDoKA7YAc1jGw5HeFT955WrqeKg_aw,2685
114
114
  ultralytics/yolo/v8/segment/train.py,sha256=Sccpul7l4v9mQ89BJQsTwQLX_5QdGpB0BStUGHIepjI,8283
115
115
  ultralytics/yolo/v8/segment/val.py,sha256=qkZE0gXt6PQTFY7tFPL2sTe9PKok95yJ8YFI2e-nahY,12776
116
- ultralytics-8.0.83.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
117
- ultralytics-8.0.83.dist-info/METADATA,sha256=WECi8rPZuKDUBfkUwVQlvpRS9x7TKNRuxE1xpbbyOZo,25667
118
- ultralytics-8.0.83.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
119
- ultralytics-8.0.83.dist-info/entry_points.txt,sha256=Ck1F6qKNokeHozQD5pmaFgXHL6dKyC2qCdyXao2e6Yg,103
120
- ultralytics-8.0.83.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
121
- ultralytics-8.0.83.dist-info/RECORD,,
116
+ ultralytics-8.0.84.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
117
+ ultralytics-8.0.84.dist-info/METADATA,sha256=1cjE2I2mJngkhG0hUIrhsbvVIy2PmrY7o1JaY1U-Lgw,26660
118
+ ultralytics-8.0.84.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
119
+ ultralytics-8.0.84.dist-info/entry_points.txt,sha256=Ck1F6qKNokeHozQD5pmaFgXHL6dKyC2qCdyXao2e6Yg,103
120
+ ultralytics-8.0.84.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
121
+ ultralytics-8.0.84.dist-info/RECORD,,