ultralytics 8.1.3__py3-none-any.whl → 8.1.4__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 +15 -3
- ultralytics/cfg/datasets/Argoverse.yaml +3 -1
- ultralytics/engine/model.py +3 -1
- ultralytics/nn/modules/head.py +1 -1
- ultralytics/nn/modules/transformer.py +3 -3
- ultralytics/utils/callbacks/tensorboard.py +38 -15
- ultralytics/utils/ops.py +1 -1
- {ultralytics-8.1.3.dist-info → ultralytics-8.1.4.dist-info}/METADATA +2 -2
- {ultralytics-8.1.3.dist-info → ultralytics-8.1.4.dist-info}/RECORD +13 -13
- {ultralytics-8.1.3.dist-info → ultralytics-8.1.4.dist-info}/LICENSE +0 -0
- {ultralytics-8.1.3.dist-info → ultralytics-8.1.4.dist-info}/WHEEL +0 -0
- {ultralytics-8.1.3.dist-info → ultralytics-8.1.4.dist-info}/entry_points.txt +0 -0
- {ultralytics-8.1.3.dist-info → ultralytics-8.1.4.dist-info}/top_level.txt +0 -0
ultralytics/__init__.py
CHANGED
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
|
2
2
|
|
|
3
|
-
__version__ = "8.1.
|
|
3
|
+
__version__ = "8.1.4"
|
|
4
4
|
|
|
5
5
|
from ultralytics.data.explorer.explorer import Explorer
|
|
6
6
|
from ultralytics.models import RTDETR, SAM, YOLO
|
|
7
7
|
from ultralytics.models.fastsam import FastSAM
|
|
8
8
|
from ultralytics.models.nas import NAS
|
|
9
|
-
from ultralytics.utils import SETTINGS as settings
|
|
9
|
+
from ultralytics.utils import ASSETS, SETTINGS as settings
|
|
10
10
|
from ultralytics.utils.checks import check_yolo as checks
|
|
11
11
|
from ultralytics.utils.downloads import download
|
|
12
12
|
|
|
13
|
-
__all__ =
|
|
13
|
+
__all__ = (
|
|
14
|
+
"__version__",
|
|
15
|
+
"ASSETS",
|
|
16
|
+
"YOLO",
|
|
17
|
+
"NAS",
|
|
18
|
+
"SAM",
|
|
19
|
+
"FastSAM",
|
|
20
|
+
"RTDETR",
|
|
21
|
+
"checks",
|
|
22
|
+
"download",
|
|
23
|
+
"settings",
|
|
24
|
+
"Explorer",
|
|
25
|
+
)
|
|
@@ -63,7 +63,9 @@ download: |
|
|
|
63
63
|
# Download 'https://argoverse-hd.s3.us-east-2.amazonaws.com/Argoverse-HD-Full.zip' (deprecated S3 link)
|
|
64
64
|
dir = Path(yaml['path']) # dataset root dir
|
|
65
65
|
urls = ['https://drive.google.com/file/d/1st9qW3BeIwQsnR0t8mRpvbsSWIo16ACi/view?usp=drive_link']
|
|
66
|
-
|
|
66
|
+
print("\n\nWARNING: Argoverse dataset MUST be downloaded manually, autodownload will NOT work.")
|
|
67
|
+
print(f"WARNING: Manually download Argoverse dataset '{urls[0]}' to '{dir}' and re-run your command.\n\n")
|
|
68
|
+
# download(urls, dir=dir)
|
|
67
69
|
|
|
68
70
|
# Convert
|
|
69
71
|
annotations_dir = 'Argoverse-HD/annotations/'
|
ultralytics/engine/model.py
CHANGED
|
@@ -427,7 +427,9 @@ class Model(nn.Module):
|
|
|
427
427
|
@property
|
|
428
428
|
def names(self):
|
|
429
429
|
"""Returns class names of the loaded model."""
|
|
430
|
-
|
|
430
|
+
from ultralytics.nn.autobackend import check_class_names
|
|
431
|
+
|
|
432
|
+
return check_class_names(self.model.names) if hasattr(self.model, "names") else None
|
|
431
433
|
|
|
432
434
|
@property
|
|
433
435
|
def device(self):
|
ultralytics/nn/modules/head.py
CHANGED
|
@@ -376,7 +376,7 @@ class RTDETRDecoder(nn.Module):
|
|
|
376
376
|
|
|
377
377
|
def _get_decoder_input(self, feats, shapes, dn_embed=None, dn_bbox=None):
|
|
378
378
|
"""Generates and prepares the input required for the decoder from the provided features and shapes."""
|
|
379
|
-
bs =
|
|
379
|
+
bs = feats.shape[0]
|
|
380
380
|
# Prepare input for decoder
|
|
381
381
|
anchors, valid_mask = self._generate_anchors(shapes, dtype=feats.dtype, device=feats.device)
|
|
382
382
|
features = self.enc_output(valid_mask * feats) # bs, h*w, 256
|
|
@@ -101,10 +101,10 @@ class AIFI(TransformerEncoderLayer):
|
|
|
101
101
|
@staticmethod
|
|
102
102
|
def build_2d_sincos_position_embedding(w, h, embed_dim=256, temperature=10000.0):
|
|
103
103
|
"""Builds 2D sine-cosine position embedding."""
|
|
104
|
-
grid_w = torch.arange(int(w), dtype=torch.float32)
|
|
105
|
-
grid_h = torch.arange(int(h), dtype=torch.float32)
|
|
106
|
-
grid_w, grid_h = torch.meshgrid(grid_w, grid_h, indexing="ij")
|
|
107
104
|
assert embed_dim % 4 == 0, "Embed dimension must be divisible by 4 for 2D sin-cos position embedding"
|
|
105
|
+
grid_w = torch.arange(w, dtype=torch.float32)
|
|
106
|
+
grid_h = torch.arange(h, dtype=torch.float32)
|
|
107
|
+
grid_w, grid_h = torch.meshgrid(grid_w, grid_h, indexing="ij")
|
|
108
108
|
pos_dim = embed_dim // 4
|
|
109
109
|
omega = torch.arange(pos_dim, dtype=torch.float32) / pos_dim
|
|
110
110
|
omega = 1.0 / (temperature**omega)
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
|
2
|
+
import contextlib
|
|
2
3
|
|
|
3
4
|
from ultralytics.utils import LOGGER, SETTINGS, TESTS_RUNNING, colorstr
|
|
4
5
|
|
|
5
6
|
try:
|
|
6
|
-
# WARNING: do not move import due to protobuf
|
|
7
|
+
# WARNING: do not move SummaryWriter import due to protobuf bug https://github.com/ultralytics/ultralytics/pull/4674
|
|
7
8
|
from torch.utils.tensorboard import SummaryWriter
|
|
8
9
|
|
|
9
10
|
assert not TESTS_RUNNING # do not log pytest
|
|
10
11
|
assert SETTINGS["tensorboard"] is True # verify integration is enabled
|
|
11
12
|
WRITER = None # TensorBoard SummaryWriter instance
|
|
13
|
+
PREFIX = colorstr("TensorBoard: ")
|
|
14
|
+
|
|
15
|
+
# Imports below only required if TensorBoard enabled
|
|
16
|
+
import warnings
|
|
17
|
+
from copy import deepcopy
|
|
18
|
+
from ultralytics.utils.torch_utils import de_parallel, torch
|
|
12
19
|
|
|
13
20
|
except (ImportError, AssertionError, TypeError, AttributeError):
|
|
14
21
|
# TypeError for handling 'Descriptors cannot not be created directly.' protobuf errors in Windows
|
|
@@ -25,20 +32,37 @@ def _log_scalars(scalars, step=0):
|
|
|
25
32
|
|
|
26
33
|
def _log_tensorboard_graph(trainer):
|
|
27
34
|
"""Log model graph to TensorBoard."""
|
|
28
|
-
try:
|
|
29
|
-
import warnings
|
|
30
35
|
|
|
31
|
-
|
|
36
|
+
# Input image
|
|
37
|
+
imgsz = trainer.args.imgsz
|
|
38
|
+
imgsz = (imgsz, imgsz) if isinstance(imgsz, int) else imgsz
|
|
39
|
+
p = next(trainer.model.parameters()) # for device, type
|
|
40
|
+
im = torch.zeros((1, 3, *imgsz), device=p.device, dtype=p.dtype) # input image (must be zeros, not empty)
|
|
41
|
+
|
|
42
|
+
with warnings.catch_warnings():
|
|
43
|
+
warnings.simplefilter("ignore", category=UserWarning) # suppress jit trace warning
|
|
44
|
+
warnings.simplefilter("ignore", category=torch.jit.TracerWarning) # suppress jit trace warning
|
|
32
45
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
p = next(trainer.model.parameters()) # for device, type
|
|
36
|
-
im = torch.zeros((1, 3, *imgsz), device=p.device, dtype=p.dtype) # input image (must be zeros, not empty)
|
|
37
|
-
with warnings.catch_warnings():
|
|
38
|
-
warnings.simplefilter("ignore", category=UserWarning) # suppress jit trace warning
|
|
46
|
+
# Try simple method first (YOLO)
|
|
47
|
+
with contextlib.suppress(Exception):
|
|
39
48
|
WRITER.add_graph(torch.jit.trace(de_parallel(trainer.model), im, strict=False), [])
|
|
40
|
-
|
|
41
|
-
|
|
49
|
+
LOGGER.info(f"{PREFIX}model graph visualization added ✅")
|
|
50
|
+
return
|
|
51
|
+
|
|
52
|
+
# Fallback to TorchScript export steps (RTDETR)
|
|
53
|
+
try:
|
|
54
|
+
model = deepcopy(de_parallel(trainer.model))
|
|
55
|
+
model.eval()
|
|
56
|
+
model = model.fuse(verbose=False)
|
|
57
|
+
for m in model.modules():
|
|
58
|
+
if hasattr(m, "export"): # Detect, RTDETRDecoder (Segment and Pose use Detect base class)
|
|
59
|
+
m.export = True
|
|
60
|
+
m.format = "torchscript"
|
|
61
|
+
model(im) # dry run
|
|
62
|
+
WRITER.add_graph(torch.jit.trace(model, im, strict=False), [])
|
|
63
|
+
LOGGER.info(f"{PREFIX}model graph visualization added ✅")
|
|
64
|
+
except Exception as e:
|
|
65
|
+
LOGGER.warning(f"{PREFIX}WARNING ⚠️ TensorBoard graph visualization failure {e}")
|
|
42
66
|
|
|
43
67
|
|
|
44
68
|
def on_pretrain_routine_start(trainer):
|
|
@@ -47,10 +71,9 @@ def on_pretrain_routine_start(trainer):
|
|
|
47
71
|
try:
|
|
48
72
|
global WRITER
|
|
49
73
|
WRITER = SummaryWriter(str(trainer.save_dir))
|
|
50
|
-
|
|
51
|
-
LOGGER.info(f"{prefix}Start with 'tensorboard --logdir {trainer.save_dir}', view at http://localhost:6006/")
|
|
74
|
+
LOGGER.info(f"{PREFIX}Start with 'tensorboard --logdir {trainer.save_dir}', view at http://localhost:6006/")
|
|
52
75
|
except Exception as e:
|
|
53
|
-
LOGGER.warning(f"WARNING ⚠️ TensorBoard not initialized correctly, not logging this run. {e}")
|
|
76
|
+
LOGGER.warning(f"{PREFIX}WARNING ⚠️ TensorBoard not initialized correctly, not logging this run. {e}")
|
|
54
77
|
|
|
55
78
|
|
|
56
79
|
def on_train_start(trainer):
|
ultralytics/utils/ops.py
CHANGED
|
@@ -220,7 +220,7 @@ def non_max_suppression(
|
|
|
220
220
|
|
|
221
221
|
# Settings
|
|
222
222
|
# min_wh = 2 # (pixels) minimum box width and height
|
|
223
|
-
time_limit = 0
|
|
223
|
+
time_limit = 2.0 + max_time_img * bs # seconds to quit after
|
|
224
224
|
multi_label &= nc > 1 # multiple labels per box (adds 0.5ms/img)
|
|
225
225
|
|
|
226
226
|
prediction = prediction.transpose(-1, -2) # shape(1,84,6300) to shape(1,6300,84)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ultralytics
|
|
3
|
-
Version: 8.1.
|
|
3
|
+
Version: 8.1.4
|
|
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
|
|
@@ -55,7 +55,7 @@ Requires-Dist: mkdocs-material ; extra == 'dev'
|
|
|
55
55
|
Requires-Dist: mkdocstrings[python] ; extra == 'dev'
|
|
56
56
|
Requires-Dist: mkdocs-jupyter ; extra == 'dev'
|
|
57
57
|
Requires-Dist: mkdocs-redirects ; extra == 'dev'
|
|
58
|
-
Requires-Dist: mkdocs-ultralytics-plugin >=0.0.
|
|
58
|
+
Requires-Dist: mkdocs-ultralytics-plugin >=0.0.38 ; extra == 'dev'
|
|
59
59
|
Provides-Extra: explorer
|
|
60
60
|
Requires-Dist: lancedb ; extra == 'explorer'
|
|
61
61
|
Requires-Dist: duckdb ; extra == 'explorer'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
ultralytics/__init__.py,sha256=
|
|
1
|
+
ultralytics/__init__.py,sha256=H3oN7cWVppsQsAvJycia7cmwtmySz8rcVT26SpKTa_o,596
|
|
2
2
|
ultralytics/assets/bus.jpg,sha256=wCAZxJecGR63Od3ZRERe9Aja1Weayrb9Ug751DS_vGM,137419
|
|
3
3
|
ultralytics/assets/zidane.jpg,sha256=Ftc4aeMmen1O0A3o6GCDO9FlfBslLpTAw0gnetx7bts,50427
|
|
4
4
|
ultralytics/cfg/__init__.py,sha256=7VOr93XpIpRcVfCtwJYcCsIszbBooBAHJ9y8Msio_jw,20713
|
|
5
5
|
ultralytics/cfg/default.yaml,sha256=Ihuy6Dziu-qm9dZ1qRSu7lrJB8sF3U8yTXPiZ9aKXlM,8091
|
|
6
|
-
ultralytics/cfg/datasets/Argoverse.yaml,sha256=
|
|
6
|
+
ultralytics/cfg/datasets/Argoverse.yaml,sha256=FyeuJT5CHq_9d4hlfAf0kpZlnbUMO0S--UJ1yIqcdKk,3134
|
|
7
7
|
ultralytics/cfg/datasets/DOTAv1.5.yaml,sha256=YDsyFPI6F6-OQXLBM3hOXo3vADYREwZzmMQfJNdpWyM,1193
|
|
8
8
|
ultralytics/cfg/datasets/DOTAv1.yaml,sha256=dxLUliHvJOW4q4vJRu5qIYVvNfjvXWB7GVh_Fhk--dM,1163
|
|
9
9
|
ultralytics/cfg/datasets/GlobalWheat2020.yaml,sha256=crk8fSL1XSLXe9zlTV9UQx94wjQ4933CKQS6bBHRSJw,2058
|
|
@@ -67,7 +67,7 @@ ultralytics/data/explorer/gui/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2
|
|
|
67
67
|
ultralytics/data/explorer/gui/dash.py,sha256=O6TGD3y0DWZuwaRUkSKpB5mXf-tSw7p-O_KE8kiZP2k,8903
|
|
68
68
|
ultralytics/engine/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
|
69
69
|
ultralytics/engine/exporter.py,sha256=tT3Egg-56KwmvgokQUNIXVpgkXj1uxuEaw6w_wpuUu8,52004
|
|
70
|
-
ultralytics/engine/model.py,sha256=
|
|
70
|
+
ultralytics/engine/model.py,sha256=nUvlHYaj0m_O8rx-TdGSc3GWHsthM36JKEK2cV7KZgo,21505
|
|
71
71
|
ultralytics/engine/predictor.py,sha256=CbZUppzq2gT6zcas6jtKQ9-IbH_Lh3Az5z9zCcIl5f0,17850
|
|
72
72
|
ultralytics/engine/results.py,sha256=zYLE8yMa_qjIHCvhvSDLU2QSUKH7as1hvabKEwYWkKs,27527
|
|
73
73
|
ultralytics/engine/trainer.py,sha256=xCBpfBT4YUqfW7F1sjPY0bmjOWBEnfmE3LQ1BiXPTrA,34264
|
|
@@ -135,8 +135,8 @@ ultralytics/nn/tasks.py,sha256=vbaN_C0BHoHnoebi74ODsR-oC-4YG3K1OAduDEcM9Z8,38370
|
|
|
135
135
|
ultralytics/nn/modules/__init__.py,sha256=ejmeNK9L-yGUX3pGr_1-HlPcCdrf7XPLFVZ3OR0mmno,1954
|
|
136
136
|
ultralytics/nn/modules/block.py,sha256=1bi5rRzHNTg10VlRdpRP_xjTJHEIfMQ1FY2nIgHKmws,14488
|
|
137
137
|
ultralytics/nn/modules/conv.py,sha256=ndUYNL2f9DK41y1vVbtEusMByXy-LMMsBKlcWjRQ9Z8,12722
|
|
138
|
-
ultralytics/nn/modules/head.py,sha256=
|
|
139
|
-
ultralytics/nn/modules/transformer.py,sha256=
|
|
138
|
+
ultralytics/nn/modules/head.py,sha256=WrIzLCQ71o3Bk0VlFCS6EpebCXvluah5d6Zs0C5Eo_c,19534
|
|
139
|
+
ultralytics/nn/modules/transformer.py,sha256=TgDpTjSkk1_-9IrIjm8bebcG5fSO9GVb5Onz0cdR21Q,17910
|
|
140
140
|
ultralytics/nn/modules/utils.py,sha256=6CCeDy6GGkDM7XjGm4FCtVpXoEuICIPCsruI8etNS3g,3197
|
|
141
141
|
ultralytics/solutions/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
|
142
142
|
ultralytics/solutions/ai_gym.py,sha256=d3XRr-u0vIp1Bi9mAwDzGkxBztnhWU_ak5e8XR2J31s,6006
|
|
@@ -164,7 +164,7 @@ ultralytics/utils/files.py,sha256=V1cD9sC3hGd5uNVdOa4uZGySGjnsXC6Lh7mjqI_UDxo,52
|
|
|
164
164
|
ultralytics/utils/instance.py,sha256=fPClvPPtTk8VeXWiRv90DrFk1j1lTUKdYJtpZKUDDtA,15575
|
|
165
165
|
ultralytics/utils/loss.py,sha256=erpbpLbt_VNOO-FItADFOjKTfwuf2A3ozECuCJiSqHM,32555
|
|
166
166
|
ultralytics/utils/metrics.py,sha256=h0aQNyW2_eud3M-7KT8C1P15GeJkf9Sw9KoASXMPim0,53176
|
|
167
|
-
ultralytics/utils/ops.py,sha256=
|
|
167
|
+
ultralytics/utils/ops.py,sha256=ULh7Luwvpnnim9_YRZuJfPe4tETC4_Atulqf6-R3AHw,32665
|
|
168
168
|
ultralytics/utils/patches.py,sha256=2iMWzwBpAjTt0UzaPzFO5JPVoKklUhftuo_3H7xBoDc,2659
|
|
169
169
|
ultralytics/utils/plotting.py,sha256=nl3GZsWe4-pBNwY7V8hOtT1GKAxdmwN_kCaNb8Kk9Hc,42710
|
|
170
170
|
ultralytics/utils/tal.py,sha256=fQ6dPFEJTVtFBFeTS_rtZMx_UsJyi80s3YfT8joCC6M,16015
|
|
@@ -180,11 +180,11 @@ ultralytics/utils/callbacks/hub.py,sha256=8zeiCkmwPc0W-W02QDNgk-o08GlUTj_k5nleLJ
|
|
|
180
180
|
ultralytics/utils/callbacks/mlflow.py,sha256=x3_au37OP23MeWNncoBFO2NIiwWRzZAQ0KdZ-Q0sRkg,4848
|
|
181
181
|
ultralytics/utils/callbacks/neptune.py,sha256=5Z3ua5YBTUS56FH8VQKQG1aaIo9fH8GEyzC5q7p4ipQ,3756
|
|
182
182
|
ultralytics/utils/callbacks/raytune.py,sha256=6OgGNuC35F29lw8Dl_d0lue4-iBR6dqrBVQnIRQDx4E,632
|
|
183
|
-
ultralytics/utils/callbacks/tensorboard.py,sha256=
|
|
183
|
+
ultralytics/utils/callbacks/tensorboard.py,sha256=fyhgBgcTmEIifBqxBJkoMZ6yQNBGhSLQBAsy770-RtA,4038
|
|
184
184
|
ultralytics/utils/callbacks/wb.py,sha256=03ACY2YwpTRigD0ZQH7_zlpwMdGw0lt23zX4d5Zaz28,6650
|
|
185
|
-
ultralytics-8.1.
|
|
186
|
-
ultralytics-8.1.
|
|
187
|
-
ultralytics-8.1.
|
|
188
|
-
ultralytics-8.1.
|
|
189
|
-
ultralytics-8.1.
|
|
190
|
-
ultralytics-8.1.
|
|
185
|
+
ultralytics-8.1.4.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
|
186
|
+
ultralytics-8.1.4.dist-info/METADATA,sha256=gQsFZnVfAJU9V3DkBpqpQb_ugBDM20nQ0ber49Mr824,40204
|
|
187
|
+
ultralytics-8.1.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
188
|
+
ultralytics-8.1.4.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
|
|
189
|
+
ultralytics-8.1.4.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
|
|
190
|
+
ultralytics-8.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|