ultralytics 8.2.79__py3-none-any.whl → 8.2.80__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.79"
3
+ __version__ = "8.2.80"
4
4
 
5
5
  import os
6
6
 
@@ -6,6 +6,7 @@ from typing import List, Union
6
6
 
7
7
  import numpy as np
8
8
  import torch
9
+ from PIL import Image
9
10
 
10
11
  from ultralytics.cfg import TASK2DATA, get_cfg, get_save_dir
11
12
  from ultralytics.engine.results import Results
@@ -143,7 +144,7 @@ class Model(nn.Module):
143
144
 
144
145
  def __call__(
145
146
  self,
146
- source: Union[str, Path, int, list, tuple, np.ndarray, torch.Tensor] = None,
147
+ source: Union[str, Path, int, Image.Image, list, tuple, np.ndarray, torch.Tensor] = None,
147
148
  stream: bool = False,
148
149
  **kwargs,
149
150
  ) -> list:
@@ -504,7 +505,7 @@ class Model(nn.Module):
504
505
 
505
506
  def predict(
506
507
  self,
507
- source: Union[str, Path, int, list, tuple, np.ndarray, torch.Tensor] = None,
508
+ source: Union[str, Path, int, Image.Image, list, tuple, np.ndarray, torch.Tensor] = None,
508
509
  stream: bool = False,
509
510
  predictor=None,
510
511
  **kwargs,
@@ -517,7 +518,7 @@ class Model(nn.Module):
517
518
  types of image sources and can operate in a streaming mode.
518
519
 
519
520
  Args:
520
- source (str | Path | int | List[str] | List[Path] | List[int] | np.ndarray | torch.Tensor): The source
521
+ source (str | Path | int | PIL.Image | np.ndarray | torch.Tensor | List | Tuple): The source
521
522
  of the image(s) to make predictions on. Accepts various types including file paths, URLs, PIL
522
523
  images, numpy arrays, and torch tensors.
523
524
  stream (bool): If True, treats the input source as a continuous stream for predictions.
@@ -900,7 +901,7 @@ class Model(nn.Module):
900
901
  initialized, it sets it up before retrieving the names.
901
902
 
902
903
  Returns:
903
- (List[str]): A list of class names associated with the model.
904
+ (Dict[int, str]): A dict of class names associated with the model.
904
905
 
905
906
  Raises:
906
907
  AttributeError: If the model or predictor does not have a 'names' attribute.
@@ -908,7 +909,7 @@ class Model(nn.Module):
908
909
  Examples:
909
910
  >>> model = YOLO('yolov8n.pt')
910
911
  >>> print(model.names)
911
- ['person', 'bicycle', 'car', ...]
912
+ {0: 'person', 1: 'bicycle', 2: 'car', ...}
912
913
  """
913
914
  from ultralytics.nn.autobackend import check_class_names
914
915
 
@@ -445,7 +445,7 @@ def smooth(y, f=0.05):
445
445
 
446
446
 
447
447
  @plt_settings()
448
- def plot_pr_curve(px, py, ap, save_dir=Path("pr_curve.png"), names=(), on_plot=None):
448
+ def plot_pr_curve(px, py, ap, save_dir=Path("pr_curve.png"), names={}, on_plot=None):
449
449
  """Plots a precision-recall curve."""
450
450
  fig, ax = plt.subplots(1, 1, figsize=(9, 6), tight_layout=True)
451
451
  py = np.stack(py, axis=1)
@@ -470,7 +470,7 @@ def plot_pr_curve(px, py, ap, save_dir=Path("pr_curve.png"), names=(), on_plot=N
470
470
 
471
471
 
472
472
  @plt_settings()
473
- def plot_mc_curve(px, py, save_dir=Path("mc_curve.png"), names=(), xlabel="Confidence", ylabel="Metric", on_plot=None):
473
+ def plot_mc_curve(px, py, save_dir=Path("mc_curve.png"), names={}, xlabel="Confidence", ylabel="Metric", on_plot=None):
474
474
  """Plots a metric-confidence curve."""
475
475
  fig, ax = plt.subplots(1, 1, figsize=(9, 6), tight_layout=True)
476
476
 
@@ -528,7 +528,7 @@ def compute_ap(recall, precision):
528
528
 
529
529
 
530
530
  def ap_per_class(
531
- tp, conf, pred_cls, target_cls, plot=False, on_plot=None, save_dir=Path(), names=(), eps=1e-16, prefix=""
531
+ tp, conf, pred_cls, target_cls, plot=False, on_plot=None, save_dir=Path(), names={}, eps=1e-16, prefix=""
532
532
  ):
533
533
  """
534
534
  Computes the average precision per class for object detection evaluation.
@@ -541,7 +541,7 @@ def ap_per_class(
541
541
  plot (bool, optional): Whether to plot PR curves or not. Defaults to False.
542
542
  on_plot (func, optional): A callback to pass plots path and data when they are rendered. Defaults to None.
543
543
  save_dir (Path, optional): Directory to save the PR curves. Defaults to an empty path.
544
- names (tuple, optional): Tuple of class names to plot PR curves. Defaults to an empty tuple.
544
+ names (dict, optional): Dict of class names to plot PR curves. Defaults to an empty tuple.
545
545
  eps (float, optional): A small value to avoid division by zero. Defaults to 1e-16.
546
546
  prefix (str, optional): A prefix string for saving the plot files. Defaults to an empty string.
547
547
 
@@ -799,13 +799,13 @@ class DetMetrics(SimpleClass):
799
799
  save_dir (Path): A path to the directory where the output plots will be saved. Defaults to current directory.
800
800
  plot (bool): A flag that indicates whether to plot precision-recall curves for each class. Defaults to False.
801
801
  on_plot (func): An optional callback to pass plots path and data when they are rendered. Defaults to None.
802
- names (tuple of str): A tuple of strings that represents the names of the classes. Defaults to an empty tuple.
802
+ names (dict of str): A dict of strings that represents the names of the classes. Defaults to an empty tuple.
803
803
 
804
804
  Attributes:
805
805
  save_dir (Path): A path to the directory where the output plots will be saved.
806
806
  plot (bool): A flag that indicates whether to plot the precision-recall curves for each class.
807
807
  on_plot (func): An optional callback to pass plots path and data when they are rendered.
808
- names (tuple of str): A tuple of strings that represents the names of the classes.
808
+ names (dict of str): A dict of strings that represents the names of the classes.
809
809
  box (Metric): An instance of the Metric class for storing the results of the detection metrics.
810
810
  speed (dict): A dictionary for storing the execution time of different parts of the detection process.
811
811
 
@@ -822,7 +822,7 @@ class DetMetrics(SimpleClass):
822
822
  curves_results: TODO
823
823
  """
824
824
 
825
- def __init__(self, save_dir=Path("."), plot=False, on_plot=None, names=()) -> None:
825
+ def __init__(self, save_dir=Path("."), plot=False, on_plot=None, names={}) -> None:
826
826
  """Initialize a DetMetrics instance with a save directory, plot flag, callback function, and class names."""
827
827
  self.save_dir = save_dir
828
828
  self.plot = plot
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ultralytics
3
- Version: 8.2.79
3
+ Version: 8.2.80
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
@@ -88,7 +88,7 @@ Requires-Dist: dvclive>=2.12.0; extra == "logging"
88
88
  <img width="100%" src="https://raw.githubusercontent.com/ultralytics/assets/main/yolov8/banner-yolov8.png" alt="YOLO Vision banner"></a>
89
89
  </p>
90
90
 
91
- [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [हिन्दी](https://docs.ultralytics.com/hi/) | [العربية](https://docs.ultralytics.com/ar/) <br>
91
+ [中文](https://docs.ultralytics.com/zh/) | [한국어](https://docs.ultralytics.com/ko/) | [日本語](https://docs.ultralytics.com/ja/) | [Русский](https://docs.ultralytics.com/ru/) | [Deutsch](https://docs.ultralytics.com/de/) | [Français](https://docs.ultralytics.com/fr/) | [Español](https://docs.ultralytics.com/es/) | [Português](https://docs.ultralytics.com/pt/) | [Türkçe](https://docs.ultralytics.com/tr/) | [Tiếng Việt](https://docs.ultralytics.com/vi/) | [العربية](https://docs.ultralytics.com/ar/) <br>
92
92
 
93
93
  <div>
94
94
  <a href="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml"><img src="https://github.com/ultralytics/ultralytics/actions/workflows/ci.yaml/badge.svg" alt="Ultralytics CI"></a>
@@ -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=uGadV7MY7aBx3TYM3LLtCY5JjfbdCa06UOh8N1DHmRg,694
11
+ ultralytics/__init__.py,sha256=ch43rNL1kG7TcgIHol6N4_nsAy_9KPLu3h9NcvFLnKY,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
@@ -99,7 +99,7 @@ ultralytics/data/explorer/gui/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2
99
99
  ultralytics/data/explorer/gui/dash.py,sha256=vZ476NaUH4FKU08rAJ1K9WNyKtg0soMyJJxqg176yWc,10498
100
100
  ultralytics/engine/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
101
101
  ultralytics/engine/exporter.py,sha256=EM35MOPWbIKE2ShJsPzdrEmrjzwZSp9gW-rO8GEFal0,58905
102
- ultralytics/engine/model.py,sha256=jmiIZWjiJ65fFWhSReaxfX6V3nzy1KpZHhrDpiYz-dY,52139
102
+ ultralytics/engine/model.py,sha256=SunF9efCM9A5V6ykOaB5pSPmHz45mf5MNkIxr-Nlmc0,52191
103
103
  ultralytics/engine/predictor.py,sha256=W58kDCFH2AfoFzpGbos3k8zUEVsLunBuM8sc2B64rPY,17449
104
104
  ultralytics/engine/results.py,sha256=7KeqJ9GsFMpdSrEx5HWSgDSnX7p1MYa7qwn72QZwG8o,70512
105
105
  ultralytics/engine/trainer.py,sha256=KJ0FohkKsAOgkrU-Fawh1QwBuhalsuvf8NNEo5dkLSc,35591
@@ -206,7 +206,7 @@ ultralytics/utils/errors.py,sha256=GqP_Jgj_n0paxn8OMhn3DTCgoNkB2WjUcUaqs-M6SQk,8
206
206
  ultralytics/utils/files.py,sha256=GTaggVhM22UM9I__jtuTcBV2oMrIKMFh_tansEFrT6E,8253
207
207
  ultralytics/utils/instance.py,sha256=5daM5nkxBv9hr5QzyII8zmuFj24hHuNtcr4EMCHAtpY,15654
208
208
  ultralytics/utils/loss.py,sha256=mDHGmF-gjggAUVhI1dkCm7TtfZHCwz25XKm4M2xJKLs,33916
209
- ultralytics/utils/metrics.py,sha256=UXMhBnTtMcpTANxmQqcYkVnj8NeAt39gZez0g6jbrW0,53786
209
+ ultralytics/utils/metrics.py,sha256=mZC03NMLD2O1U9p1QQ4ODn2JDh8k2COnGNMHr0v7v6o,53780
210
210
  ultralytics/utils/ops.py,sha256=hLXY4Nk-dckRvUwT5Jwmc_n5abQimYLuAunFZfuSpy8,32713
211
211
  ultralytics/utils/patches.py,sha256=Oo3DkP7MbXnNGvPfoFSocAkVvaPh9kwMT_9RQUfjVhI,3594
212
212
  ultralytics/utils/plotting.py,sha256=cHYRcpnK0UGjY55UXADjoQ7ngMNDmge2u-9JElUxAkg,55763
@@ -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.79.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
229
- ultralytics-8.2.79.dist-info/METADATA,sha256=3ARfZH7BJO7y2zddt_lGQBYL9CKXGhIk2tjsZSq3jHk,41321
230
- ultralytics-8.2.79.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
231
- ultralytics-8.2.79.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
232
- ultralytics-8.2.79.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
233
- ultralytics-8.2.79.dist-info/RECORD,,
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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (72.2.0)
2
+ Generator: setuptools (73.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5