ultralytics 8.3.25__py3-none-any.whl → 8.3.26__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.
- tests/test_exports.py +6 -6
- ultralytics/__init__.py +1 -1
- ultralytics/data/annotator.py +7 -2
- ultralytics/engine/trainer.py +4 -3
- ultralytics/nn/autobackend.py +3 -0
- ultralytics/nn/modules/head.py +15 -3
- {ultralytics-8.3.25.dist-info → ultralytics-8.3.26.dist-info}/METADATA +1 -1
- {ultralytics-8.3.25.dist-info → ultralytics-8.3.26.dist-info}/RECORD +12 -12
- {ultralytics-8.3.25.dist-info → ultralytics-8.3.26.dist-info}/LICENSE +0 -0
- {ultralytics-8.3.25.dist-info → ultralytics-8.3.26.dist-info}/WHEEL +0 -0
- {ultralytics-8.3.25.dist-info → ultralytics-8.3.26.dist-info}/entry_points.txt +0 -0
- {ultralytics-8.3.25.dist-info → ultralytics-8.3.26.dist-info}/top_level.txt +0 -0
tests/test_exports.py
CHANGED
@@ -193,14 +193,14 @@ def test_export_paddle():
|
|
193
193
|
|
194
194
|
|
195
195
|
@pytest.mark.slow
|
196
|
-
def
|
197
|
-
"""Test YOLO exports to NCNN
|
198
|
-
file = YOLO(MODEL).export(format="
|
196
|
+
def test_export_mnn():
|
197
|
+
"""Test YOLO exports to MNN format (WARNING: MNN test must precede NCNN test or CI error on Windows)."""
|
198
|
+
file = YOLO(MODEL).export(format="mnn", imgsz=32)
|
199
199
|
YOLO(file)(SOURCE, imgsz=32) # exported model inference
|
200
200
|
|
201
201
|
|
202
202
|
@pytest.mark.slow
|
203
|
-
def
|
204
|
-
"""Test YOLO exports to
|
205
|
-
file = YOLO(MODEL).export(format="
|
203
|
+
def test_export_ncnn():
|
204
|
+
"""Test YOLO exports to NCNN format."""
|
205
|
+
file = YOLO(MODEL).export(format="ncnn", imgsz=32)
|
206
206
|
YOLO(file)(SOURCE, imgsz=32) # exported model inference
|
ultralytics/__init__.py
CHANGED
ultralytics/data/annotator.py
CHANGED
@@ -5,7 +5,9 @@ from pathlib import Path
|
|
5
5
|
from ultralytics import SAM, YOLO
|
6
6
|
|
7
7
|
|
8
|
-
def auto_annotate(
|
8
|
+
def auto_annotate(
|
9
|
+
data, det_model="yolo11x.pt", sam_model="sam_b.pt", device="", conf=0.25, iou=0.45, imgsz=640, output_dir=None
|
10
|
+
):
|
9
11
|
"""
|
10
12
|
Automatically annotates images using a YOLO object detection model and a SAM segmentation model.
|
11
13
|
|
@@ -17,6 +19,9 @@ def auto_annotate(data, det_model="yolov8x.pt", sam_model="sam_b.pt", device="",
|
|
17
19
|
det_model (str): Path or name of the pre-trained YOLO detection model.
|
18
20
|
sam_model (str): Path or name of the pre-trained SAM segmentation model.
|
19
21
|
device (str): Device to run the models on (e.g., 'cpu', 'cuda', '0').
|
22
|
+
conf (float): Confidence threshold for detection model; default is 0.25.
|
23
|
+
iou (float): IoU threshold for filtering overlapping boxes in detection results; default is 0.45.
|
24
|
+
imgsz (int): Input image resize dimension; default is 640.
|
20
25
|
output_dir (str | None): Directory to save the annotated results. If None, a default directory is created.
|
21
26
|
|
22
27
|
Examples:
|
@@ -36,7 +41,7 @@ def auto_annotate(data, det_model="yolov8x.pt", sam_model="sam_b.pt", device="",
|
|
36
41
|
output_dir = data.parent / f"{data.stem}_auto_annotate_labels"
|
37
42
|
Path(output_dir).mkdir(exist_ok=True, parents=True)
|
38
43
|
|
39
|
-
det_results = det_model(data, stream=True, device=device)
|
44
|
+
det_results = det_model(data, stream=True, device=device, conf=conf, iou=iou, imgsz=imgsz)
|
40
45
|
|
41
46
|
for result in det_results:
|
42
47
|
class_ids = result.boxes.cls.int().tolist() # noqa
|
ultralytics/engine/trainer.py
CHANGED
@@ -791,6 +791,8 @@ class BaseTrainer:
|
|
791
791
|
else: # weight (with decay)
|
792
792
|
g[0].append(param)
|
793
793
|
|
794
|
+
optimizers = {"Adam", "Adamax", "AdamW", "NAdam", "RAdam", "RMSProp", "SGD", "auto"}
|
795
|
+
name = {x.lower(): x for x in optimizers}.get(name.lower(), None)
|
794
796
|
if name in {"Adam", "Adamax", "AdamW", "NAdam", "RAdam"}:
|
795
797
|
optimizer = getattr(optim, name, optim.Adam)(g[2], lr=lr, betas=(momentum, 0.999), weight_decay=0.0)
|
796
798
|
elif name == "RMSProp":
|
@@ -799,9 +801,8 @@ class BaseTrainer:
|
|
799
801
|
optimizer = optim.SGD(g[2], lr=lr, momentum=momentum, nesterov=True)
|
800
802
|
else:
|
801
803
|
raise NotImplementedError(
|
802
|
-
f"Optimizer '{name}' not found in list of available optimizers "
|
803
|
-
|
804
|
-
"To request support for addition optimizers please visit https://github.com/ultralytics/ultralytics."
|
804
|
+
f"Optimizer '{name}' not found in list of available optimizers {optimizers}. "
|
805
|
+
"Request support for addition optimizers at https://github.com/ultralytics/ultralytics."
|
805
806
|
)
|
806
807
|
|
807
808
|
optimizer.add_param_group({"params": g[0], "weight_decay": decay}) # add g0 with weight_decay
|
ultralytics/nn/autobackend.py
CHANGED
@@ -663,6 +663,9 @@ class AutoBackend(nn.Module):
|
|
663
663
|
else:
|
664
664
|
x[:, [0, 2]] *= w
|
665
665
|
x[:, [1, 3]] *= h
|
666
|
+
if self.task == "pose":
|
667
|
+
x[:, 5::3] *= w
|
668
|
+
x[:, 6::3] *= h
|
666
669
|
y.append(x)
|
667
670
|
# TF segment fixes: export is reversed vs ONNX export and protos are transposed
|
668
671
|
if len(y) == 2: # segment with (det, proto) output order reversed
|
ultralytics/nn/modules/head.py
CHANGED
@@ -246,9 +246,21 @@ class Pose(Detect):
|
|
246
246
|
def kpts_decode(self, bs, kpts):
|
247
247
|
"""Decodes keypoints."""
|
248
248
|
ndim = self.kpt_shape[1]
|
249
|
-
if self.export:
|
250
|
-
|
251
|
-
|
249
|
+
if self.export:
|
250
|
+
if self.format in {
|
251
|
+
"tflite",
|
252
|
+
"edgetpu",
|
253
|
+
}: # required for TFLite export to avoid 'PLACEHOLDER_FOR_GREATER_OP_CODES' bug
|
254
|
+
# Precompute normalization factor to increase numerical stability
|
255
|
+
y = kpts.view(bs, *self.kpt_shape, -1)
|
256
|
+
grid_h, grid_w = self.shape[2], self.shape[3]
|
257
|
+
grid_size = torch.tensor([grid_w, grid_h], device=y.device).reshape(1, 2, 1)
|
258
|
+
norm = self.strides / (self.stride[0] * grid_size)
|
259
|
+
a = (y[:, :, :2] * 2.0 + (self.anchors - 0.5)) * norm
|
260
|
+
else:
|
261
|
+
# NCNN fix
|
262
|
+
y = kpts.view(bs, *self.kpt_shape, -1)
|
263
|
+
a = (y[:, :, :2] * 2.0 + (self.anchors - 0.5)) * self.strides
|
252
264
|
if ndim == 3:
|
253
265
|
a = torch.cat((a, y[:, :, 2:3].sigmoid()), 2)
|
254
266
|
return a.view(bs, self.nk, -1)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ultralytics
|
3
|
-
Version: 8.3.
|
3
|
+
Version: 8.3.26
|
4
4
|
Summary: Ultralytics YOLO 🚀 for SOTA object detection, multi-object tracking, instance segmentation, pose estimation and image classification.
|
5
5
|
Author-email: Glenn Jocher <glenn.jocher@ultralytics.com>, Jing Qiu <jing.qiu@ultralytics.com>
|
6
6
|
Maintainer-email: Ultralytics <hello@ultralytics.com>
|
@@ -3,11 +3,11 @@ tests/conftest.py,sha256=9PFAiwAy6eeORGspr5dOKxVuFDVKqYg8Nn_RxSJ27UI,2919
|
|
3
3
|
tests/test_cli.py,sha256=G7OJ1ErQYsGy2Dx1zP-0p7EZR4aPoAdtLGiY4Hm7jQM,5006
|
4
4
|
tests/test_cuda.py,sha256=rhHFvKNegN1ChtueKM0JhATJaJDFB377uXo2Kca5JVQ,5943
|
5
5
|
tests/test_engine.py,sha256=dcEcJsMQh61rDSNv7l4TIAgybLpzjVwerv9JZC_KCM8,4934
|
6
|
-
tests/test_exports.py,sha256=
|
6
|
+
tests/test_exports.py,sha256=EDWilO8aUb-n7n4jxaUiGLl5MmK7fWjlJ-JUJ7YX92w,8309
|
7
7
|
tests/test_integrations.py,sha256=f5-QCUk1SU_-qn4mBCZwS3GN3tXEBIIXo4z2EhExbHw,6126
|
8
8
|
tests/test_python.py,sha256=I1RRdCwLdrc3jX06huVxct8HX8ccQOmQgVpuEflRl0U,23560
|
9
9
|
tests/test_solutions.py,sha256=sPYhy2d814mIVvojQeVxeZPu0IVy01_Y8zuMcu_9GF0,3790
|
10
|
-
ultralytics/__init__.py,sha256=
|
10
|
+
ultralytics/__init__.py,sha256=xWEsvFey2P_V6tsqNsrMPrGSoGAmNU75zZT3bLvY9q8,681
|
11
11
|
ultralytics/assets/bus.jpg,sha256=wCAZxJecGR63Od3ZRERe9Aja1Weayrb9Ug751DS_vGM,137419
|
12
12
|
ultralytics/assets/zidane.jpg,sha256=Ftc4aeMmen1O0A3o6GCDO9FlfBslLpTAw0gnetx7bts,50427
|
13
13
|
ultralytics/cfg/__init__.py,sha256=YXEtAr5WS3HLO90wFbyzspsaFxpBu4WJjVXWEFim-_o,32509
|
@@ -89,7 +89,7 @@ ultralytics/cfg/solutions/default.yaml,sha256=irtGM8nxaSBkrWMqcXoJdtKgqAq1YBwyVM
|
|
89
89
|
ultralytics/cfg/trackers/botsort.yaml,sha256=FDIrZ3hAhRtMfDl654pt1HIexmPqlFQK-3lQ4D0tF84,918
|
90
90
|
ultralytics/cfg/trackers/bytetrack.yaml,sha256=rBWY4RjjX6PTO2o6TUJFYHVgXNZHCN5TuBuzwuPYVjA,723
|
91
91
|
ultralytics/data/__init__.py,sha256=VGe-ATG7j35F4A4r8Jmzffjlhve4JAJPgRa5ahKTU18,616
|
92
|
-
ultralytics/data/annotator.py,sha256=
|
92
|
+
ultralytics/data/annotator.py,sha256=kfqrVwlpYHboaDc0hpV6yeP6Ahb32e9Zzzo-qtYLkto,2814
|
93
93
|
ultralytics/data/augment.py,sha256=YCLrwx1mRGeidggo_7GeINay8KdxACqREHJofZeaTHA,120430
|
94
94
|
ultralytics/data/base.py,sha256=ZCIhAyFfxXVp5fVnYD8mwbksNALJTayBKIR5FKGV7ZM,15168
|
95
95
|
ultralytics/data/build.py,sha256=AfMmz0sHIYmwry_90tEJFRk_kz0S3SolScVXqYHiT08,7261
|
@@ -103,7 +103,7 @@ ultralytics/engine/exporter.py,sha256=atCOVnXPrN66xq1rbOTZFBQmY00qpveLrZ_C86DDZS
|
|
103
103
|
ultralytics/engine/model.py,sha256=pvL1uf-wwdWL8Iph7VEAYn1-z7wEHzVug21V_0_gO6M,51456
|
104
104
|
ultralytics/engine/predictor.py,sha256=aS4yJdTK2kYq-TTpzIlWxqnAcBz38zIECZoMb_yOPMY,17597
|
105
105
|
ultralytics/engine/results.py,sha256=BxanBI8PhBCfs-9cSy-GS6naScuiD3hdvUAJWPW2mS0,75043
|
106
|
-
ultralytics/engine/trainer.py,sha256=
|
106
|
+
ultralytics/engine/trainer.py,sha256=zbXcoY3vOvJDBoEyI-wlSXXYizr7gjdnyw_gTvQ0y_I,37081
|
107
107
|
ultralytics/engine/tuner.py,sha256=WBj8iw1K1TK0hvanlA-wkwmfqh1SI8jEe2dGwUINeTg,11838
|
108
108
|
ultralytics/engine/validator.py,sha256=aWpXE3nrOqaA7jCuUgwxi0FabiGTIXtZvjoJyCX903o,14870
|
109
109
|
ultralytics/hub/__init__.py,sha256=c6Me4E8V-P7mtzTggyPYz9FnVkqWRyPp9F-fMcyFNQ0,5632
|
@@ -169,13 +169,13 @@ ultralytics/models/yolo/world/__init__.py,sha256=3VTH0q4NOt2EWRom15yCymvmvm0Etp2
|
|
169
169
|
ultralytics/models/yolo/world/train.py,sha256=gaDrAmLJpg9qDtmL5evA5HsV2yb4RTRSfk2EDYrHdRg,3686
|
170
170
|
ultralytics/models/yolo/world/train_world.py,sha256=IsnCEVt6DcM9lUskCKmIN-M8MM79xLpwTRqRoAHUnZ4,4857
|
171
171
|
ultralytics/nn/__init__.py,sha256=4BPLHY89xEM_al5uK0aOmFgiML6CMGEZbezxOvTjOEs,587
|
172
|
-
ultralytics/nn/autobackend.py,sha256=
|
172
|
+
ultralytics/nn/autobackend.py,sha256=TZdpKEtSAINAkXzNF_b5rG4c_mjnkUtNnQ2Ux1reSqM,34766
|
173
173
|
ultralytics/nn/tasks.py,sha256=NWe0cL7A0LpsP3S1Efvi2NutAjWc_rGYMJMwAeb2bAg,48605
|
174
174
|
ultralytics/nn/modules/__init__.py,sha256=xhW2BennT9U_VaMXVpRu-bdLgp1BXt9L8mkIUBE3idU,2625
|
175
175
|
ultralytics/nn/modules/activation.py,sha256=chhn469wnRHEs5BMGNBYXwPYZc_7-urspTT8fnBd-xA,895
|
176
176
|
ultralytics/nn/modules/block.py,sha256=thcIPcnGRRxDDDswywJsfzbewr9XfTrzl_UvSl-bJ3c,41832
|
177
177
|
ultralytics/nn/modules/conv.py,sha256=vOeHZ6Z4sc6-9PrDmRGT1hFkxSBbbWkQm2jRbGGjpqQ,12705
|
178
|
-
ultralytics/nn/modules/head.py,sha256=
|
178
|
+
ultralytics/nn/modules/head.py,sha256=3ULpEpr2_I4bd9JSptX_9zRKimdTOm4y8qT-DG-Gzq4,27456
|
179
179
|
ultralytics/nn/modules/transformer.py,sha256=tGiK8NmPfswwW1rbF21r5ILUkkZQ6Nk4s8j16vFBmps,18069
|
180
180
|
ultralytics/nn/modules/utils.py,sha256=a88cKl2wz1nMVSEBiajtvaCbDBQIkESWOKTZ_WAJy90,3195
|
181
181
|
ultralytics/solutions/__init__.py,sha256=6RDeXWO1QSaMgCq8YrWXaj2xvPw2sJwJL_a0dgjCvz0,648
|
@@ -227,9 +227,9 @@ ultralytics/utils/callbacks/neptune.py,sha256=IbGQfEltamUKXJt93uSLQFn8c2rYh3DMTg
|
|
227
227
|
ultralytics/utils/callbacks/raytune.py,sha256=ODVYzy-CoM4Uge0zjkh3Hnh9nF2M0vhDrSenXnvcizw,705
|
228
228
|
ultralytics/utils/callbacks/tensorboard.py,sha256=SHlE58Fb-sg-uZKtgy-ybIO3SAIfK55aj8kTYGA0Cyg,4167
|
229
229
|
ultralytics/utils/callbacks/wb.py,sha256=oX3JarCJGhzvW556XiEXQNaZblAaK_UETAt3kzkY61w,6869
|
230
|
-
ultralytics-8.3.
|
231
|
-
ultralytics-8.3.
|
232
|
-
ultralytics-8.3.
|
233
|
-
ultralytics-8.3.
|
234
|
-
ultralytics-8.3.
|
235
|
-
ultralytics-8.3.
|
230
|
+
ultralytics-8.3.26.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
231
|
+
ultralytics-8.3.26.dist-info/METADATA,sha256=iAm1olf_y4F4D4lXzKQMHA5dGns1-vwtp7OU1acZNhM,35081
|
232
|
+
ultralytics-8.3.26.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
233
|
+
ultralytics-8.3.26.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
|
234
|
+
ultralytics-8.3.26.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
|
235
|
+
ultralytics-8.3.26.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|