ultralytics 8.3.24__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 +7 -0
- ultralytics/__init__.py +1 -1
- ultralytics/cfg/trackers/botsort.yaml +2 -2
- ultralytics/cfg/trackers/bytetrack.yaml +2 -2
- ultralytics/data/annotator.py +7 -2
- ultralytics/engine/exporter.py +39 -4
- ultralytics/engine/predictor.py +1 -0
- ultralytics/engine/trainer.py +4 -3
- ultralytics/engine/validator.py +1 -0
- ultralytics/models/sam/modules/sam.py +1 -0
- ultralytics/nn/autobackend.py +85 -18
- ultralytics/nn/modules/head.py +15 -3
- ultralytics/utils/benchmarks.py +4 -3
- ultralytics/utils/tuner.py +7 -4
- {ultralytics-8.3.24.dist-info → ultralytics-8.3.26.dist-info}/METADATA +1 -1
- {ultralytics-8.3.24.dist-info → ultralytics-8.3.26.dist-info}/RECORD +20 -20
- {ultralytics-8.3.24.dist-info → ultralytics-8.3.26.dist-info}/WHEEL +1 -1
- {ultralytics-8.3.24.dist-info → ultralytics-8.3.26.dist-info}/LICENSE +0 -0
- {ultralytics-8.3.24.dist-info → ultralytics-8.3.26.dist-info}/entry_points.txt +0 -0
- {ultralytics-8.3.24.dist-info → ultralytics-8.3.26.dist-info}/top_level.txt +0 -0
tests/test_exports.py
CHANGED
@@ -192,6 +192,13 @@ def test_export_paddle():
|
|
192
192
|
YOLO(MODEL).export(format="paddle", imgsz=32)
|
193
193
|
|
194
194
|
|
195
|
+
@pytest.mark.slow
|
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
|
+
YOLO(file)(SOURCE, imgsz=32) # exported model inference
|
200
|
+
|
201
|
+
|
195
202
|
@pytest.mark.slow
|
196
203
|
def test_export_ncnn():
|
197
204
|
"""Test YOLO exports to NCNN format."""
|
ultralytics/__init__.py
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
# Default YOLO tracker settings for BoT-SORT tracker https://github.com/NirAharon/BoT-SORT
|
3
3
|
|
4
4
|
tracker_type: botsort # tracker type, ['botsort', 'bytetrack']
|
5
|
-
track_high_thresh: 0.
|
5
|
+
track_high_thresh: 0.25 # threshold for the first association
|
6
6
|
track_low_thresh: 0.1 # threshold for the second association
|
7
|
-
new_track_thresh: 0.
|
7
|
+
new_track_thresh: 0.25 # threshold for init new track if the detection does not match any tracks
|
8
8
|
track_buffer: 30 # buffer to calculate the time when to remove tracks
|
9
9
|
match_thresh: 0.8 # threshold for matching tracks
|
10
10
|
fuse_score: True # Whether to fuse confidence scores with the iou distances before matching
|
@@ -2,9 +2,9 @@
|
|
2
2
|
# Default YOLO tracker settings for ByteTrack tracker https://github.com/ifzhang/ByteTrack
|
3
3
|
|
4
4
|
tracker_type: bytetrack # tracker type, ['botsort', 'bytetrack']
|
5
|
-
track_high_thresh: 0.
|
5
|
+
track_high_thresh: 0.25 # threshold for the first association
|
6
6
|
track_low_thresh: 0.1 # threshold for the second association
|
7
|
-
new_track_thresh: 0.
|
7
|
+
new_track_thresh: 0.25 # threshold for init new track if the detection does not match any tracks
|
8
8
|
track_buffer: 30 # buffer to calculate the time when to remove tracks
|
9
9
|
match_thresh: 0.8 # threshold for matching tracks
|
10
10
|
fuse_score: True # Whether to fuse confidence scores with the iou distances before matching
|
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/exporter.py
CHANGED
@@ -16,6 +16,7 @@ TensorFlow Lite | `tflite` | yolo11n.tflite
|
|
16
16
|
TensorFlow Edge TPU | `edgetpu` | yolo11n_edgetpu.tflite
|
17
17
|
TensorFlow.js | `tfjs` | yolo11n_web_model/
|
18
18
|
PaddlePaddle | `paddle` | yolo11n_paddle_model/
|
19
|
+
MNN | `mnn` | yolo11n.mnn
|
19
20
|
NCNN | `ncnn` | yolo11n_ncnn_model/
|
20
21
|
|
21
22
|
Requirements:
|
@@ -41,6 +42,7 @@ Inference:
|
|
41
42
|
yolo11n.tflite # TensorFlow Lite
|
42
43
|
yolo11n_edgetpu.tflite # TensorFlow Edge TPU
|
43
44
|
yolo11n_paddle_model # PaddlePaddle
|
45
|
+
yolo11n.mnn # MNN
|
44
46
|
yolo11n_ncnn_model # NCNN
|
45
47
|
|
46
48
|
TensorFlow.js:
|
@@ -109,6 +111,7 @@ def export_formats():
|
|
109
111
|
["TensorFlow Edge TPU", "edgetpu", "_edgetpu.tflite", True, False],
|
110
112
|
["TensorFlow.js", "tfjs", "_web_model", True, False],
|
111
113
|
["PaddlePaddle", "paddle", "_paddle_model", True, True],
|
114
|
+
["MNN", "mnn", ".mnn", True, True],
|
112
115
|
["NCNN", "ncnn", "_ncnn_model", True, True],
|
113
116
|
]
|
114
117
|
return dict(zip(["Format", "Argument", "Suffix", "CPU", "GPU"], zip(*x)))
|
@@ -190,7 +193,9 @@ class Exporter:
|
|
190
193
|
flags = [x == fmt for x in fmts]
|
191
194
|
if sum(flags) != 1:
|
192
195
|
raise ValueError(f"Invalid export format='{fmt}'. Valid formats are {fmts}")
|
193
|
-
jit, onnx, xml, engine, coreml, saved_model, pb, tflite, edgetpu, tfjs, paddle, ncnn =
|
196
|
+
jit, onnx, xml, engine, coreml, saved_model, pb, tflite, edgetpu, tfjs, paddle, mnn, ncnn = (
|
197
|
+
flags # export booleans
|
198
|
+
)
|
194
199
|
is_tf_format = any((saved_model, pb, tflite, edgetpu, tfjs))
|
195
200
|
|
196
201
|
# Device
|
@@ -333,8 +338,10 @@ class Exporter:
|
|
333
338
|
f[9], _ = self.export_tfjs()
|
334
339
|
if paddle: # PaddlePaddle
|
335
340
|
f[10], _ = self.export_paddle()
|
341
|
+
if mnn: # MNN
|
342
|
+
f[11], _ = self.export_mnn()
|
336
343
|
if ncnn: # NCNN
|
337
|
-
f[
|
344
|
+
f[12], _ = self.export_ncnn()
|
338
345
|
|
339
346
|
# Finish
|
340
347
|
f = [str(x) for x in f if x] # filter out '' and None
|
@@ -541,6 +548,32 @@ class Exporter:
|
|
541
548
|
yaml_save(Path(f) / "metadata.yaml", self.metadata) # add metadata.yaml
|
542
549
|
return f, None
|
543
550
|
|
551
|
+
@try_export
|
552
|
+
def export_mnn(self, prefix=colorstr("MNN:")):
|
553
|
+
"""YOLOv8 MNN export using MNN https://github.com/alibaba/MNN."""
|
554
|
+
f_onnx, _ = self.export_onnx() # get onnx model first
|
555
|
+
|
556
|
+
check_requirements("MNN>=2.9.6")
|
557
|
+
import MNN # noqa
|
558
|
+
from MNN.tools import mnnconvert
|
559
|
+
|
560
|
+
# Setup and checks
|
561
|
+
LOGGER.info(f"\n{prefix} starting export with MNN {MNN.version()}...")
|
562
|
+
assert Path(f_onnx).exists(), f"failed to export ONNX file: {f_onnx}"
|
563
|
+
f = str(self.file.with_suffix(".mnn")) # MNN model file
|
564
|
+
args = ["", "-f", "ONNX", "--modelFile", f_onnx, "--MNNModel", f, "--bizCode", json.dumps(self.metadata)]
|
565
|
+
if self.args.int8:
|
566
|
+
args.append("--weightQuantBits")
|
567
|
+
args.append("8")
|
568
|
+
if self.args.half:
|
569
|
+
args.append("--fp16")
|
570
|
+
mnnconvert.convert(args)
|
571
|
+
# remove scratch file for model convert optimize
|
572
|
+
convert_scratch = Path(self.file.parent / ".__convert_external_data.bin")
|
573
|
+
if convert_scratch.exists():
|
574
|
+
convert_scratch.unlink()
|
575
|
+
return f, None
|
576
|
+
|
544
577
|
@try_export
|
545
578
|
def export_ncnn(self, prefix=colorstr("NCNN:")):
|
546
579
|
"""YOLO NCNN export using PNNX https://github.com/pnnx/pnnx."""
|
@@ -890,8 +923,10 @@ class Exporter:
|
|
890
923
|
tmp_file = f / "tmp_tflite_int8_calibration_images.npy" # int8 calibration images file
|
891
924
|
if self.args.data:
|
892
925
|
f.mkdir()
|
893
|
-
images = [batch["img"]
|
894
|
-
images = torch.cat(images, 0).float()
|
926
|
+
images = [batch["img"] for batch in self.get_int8_calibration_dataloader(prefix)]
|
927
|
+
images = torch.nn.functional.interpolate(torch.cat(images, 0).float(), size=self.imgsz).permute(
|
928
|
+
0, 2, 3, 1
|
929
|
+
)
|
895
930
|
np.save(str(tmp_file), images.numpy().astype(np.float32)) # BHWC
|
896
931
|
np_data = [["images", tmp_file, [[[[0, 0, 0]]]], [[[[255, 255, 255]]]]]]
|
897
932
|
|
ultralytics/engine/predictor.py
CHANGED
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/engine/validator.py
CHANGED
@@ -854,6 +854,7 @@ class SAM2Model(torch.nn.Module):
|
|
854
854
|
mask_inputs,
|
855
855
|
output_dict,
|
856
856
|
num_frames,
|
857
|
+
track_in_reverse,
|
857
858
|
prev_sam_mask_logits,
|
858
859
|
):
|
859
860
|
"""Performs a single tracking step, updating object masks and memory features based on current frame inputs."""
|
ultralytics/nn/autobackend.py
CHANGED
@@ -59,21 +59,22 @@ class AutoBackend(nn.Module):
|
|
59
59
|
range of formats, each with specific naming conventions as outlined below:
|
60
60
|
|
61
61
|
Supported Formats and Naming Conventions:
|
62
|
-
| Format | File Suffix
|
63
|
-
|
64
|
-
| PyTorch | *.pt
|
65
|
-
| TorchScript | *.torchscript
|
66
|
-
| ONNX Runtime | *.onnx
|
67
|
-
| ONNX OpenCV DNN | *.onnx (dnn=True)|
|
68
|
-
| OpenVINO | *openvino_model/
|
69
|
-
| CoreML | *.mlpackage
|
70
|
-
| TensorRT | *.engine
|
71
|
-
| TensorFlow SavedModel | *_saved_model |
|
72
|
-
| TensorFlow GraphDef | *.pb
|
73
|
-
| TensorFlow Lite | *.tflite
|
74
|
-
| TensorFlow Edge TPU | *_edgetpu.tflite
|
75
|
-
| PaddlePaddle | *_paddle_model |
|
76
|
-
|
|
62
|
+
| Format | File Suffix |
|
63
|
+
|-----------------------|-------------------|
|
64
|
+
| PyTorch | *.pt |
|
65
|
+
| TorchScript | *.torchscript |
|
66
|
+
| ONNX Runtime | *.onnx |
|
67
|
+
| ONNX OpenCV DNN | *.onnx (dnn=True) |
|
68
|
+
| OpenVINO | *openvino_model/ |
|
69
|
+
| CoreML | *.mlpackage |
|
70
|
+
| TensorRT | *.engine |
|
71
|
+
| TensorFlow SavedModel | *_saved_model/ |
|
72
|
+
| TensorFlow GraphDef | *.pb |
|
73
|
+
| TensorFlow Lite | *.tflite |
|
74
|
+
| TensorFlow Edge TPU | *_edgetpu.tflite |
|
75
|
+
| PaddlePaddle | *_paddle_model/ |
|
76
|
+
| MNN | *.mnn |
|
77
|
+
| NCNN | *_ncnn_model/ |
|
77
78
|
|
78
79
|
This class offers dynamic backend switching capabilities based on the input model format, making it easier to deploy
|
79
80
|
models across various platforms.
|
@@ -120,6 +121,7 @@ class AutoBackend(nn.Module):
|
|
120
121
|
edgetpu,
|
121
122
|
tfjs,
|
122
123
|
paddle,
|
124
|
+
mnn,
|
123
125
|
ncnn,
|
124
126
|
triton,
|
125
127
|
) = self._model_type(w)
|
@@ -189,10 +191,32 @@ class AutoBackend(nn.Module):
|
|
189
191
|
check_requirements("numpy==1.23.5")
|
190
192
|
import onnxruntime
|
191
193
|
|
192
|
-
providers =
|
194
|
+
providers = onnxruntime.get_available_providers()
|
195
|
+
if not cuda and "CUDAExecutionProvider" in providers:
|
196
|
+
providers.remove("CUDAExecutionProvider")
|
197
|
+
elif cuda and "CUDAExecutionProvider" not in providers:
|
198
|
+
LOGGER.warning("WARNING ⚠️ Failed to start ONNX Runtime session with CUDA. Falling back to CPU...")
|
199
|
+
device = torch.device("cpu")
|
200
|
+
cuda = False
|
201
|
+
LOGGER.info(f"Preferring ONNX Runtime {providers[0]}")
|
193
202
|
session = onnxruntime.InferenceSession(w, providers=providers)
|
194
203
|
output_names = [x.name for x in session.get_outputs()]
|
195
204
|
metadata = session.get_modelmeta().custom_metadata_map
|
205
|
+
dynamic = isinstance(session.get_outputs()[0].shape[0], str)
|
206
|
+
if not dynamic:
|
207
|
+
io = session.io_binding()
|
208
|
+
bindings = []
|
209
|
+
for output in session.get_outputs():
|
210
|
+
y_tensor = torch.empty(output.shape, dtype=torch.float16 if fp16 else torch.float32).to(device)
|
211
|
+
io.bind_output(
|
212
|
+
name=output.name,
|
213
|
+
device_type=device.type,
|
214
|
+
device_id=device.index if cuda else 0,
|
215
|
+
element_type=np.float16 if fp16 else np.float32,
|
216
|
+
shape=tuple(y_tensor.shape),
|
217
|
+
buffer_ptr=y_tensor.data_ptr(),
|
218
|
+
)
|
219
|
+
bindings.append(y_tensor)
|
196
220
|
|
197
221
|
# OpenVINO
|
198
222
|
elif xml:
|
@@ -381,6 +405,26 @@ class AutoBackend(nn.Module):
|
|
381
405
|
output_names = predictor.get_output_names()
|
382
406
|
metadata = w.parents[1] / "metadata.yaml"
|
383
407
|
|
408
|
+
# MNN
|
409
|
+
elif mnn:
|
410
|
+
LOGGER.info(f"Loading {w} for MNN inference...")
|
411
|
+
check_requirements("MNN") # requires MNN
|
412
|
+
import os
|
413
|
+
|
414
|
+
import MNN
|
415
|
+
|
416
|
+
config = {}
|
417
|
+
config["precision"] = "low"
|
418
|
+
config["backend"] = "CPU"
|
419
|
+
config["numThread"] = (os.cpu_count() + 1) // 2
|
420
|
+
rt = MNN.nn.create_runtime_manager((config,))
|
421
|
+
net = MNN.nn.load_module_from_file(w, [], [], runtime_manager=rt, rearrange=True)
|
422
|
+
|
423
|
+
def torch_to_mnn(x):
|
424
|
+
return MNN.expr.const(x.data_ptr(), x.shape)
|
425
|
+
|
426
|
+
metadata = json.loads(net.get_info()["bizCode"])
|
427
|
+
|
384
428
|
# NCNN
|
385
429
|
elif ncnn:
|
386
430
|
LOGGER.info(f"Loading {w} for NCNN inference...")
|
@@ -477,8 +521,22 @@ class AutoBackend(nn.Module):
|
|
477
521
|
|
478
522
|
# ONNX Runtime
|
479
523
|
elif self.onnx:
|
480
|
-
|
481
|
-
|
524
|
+
if self.dynamic:
|
525
|
+
im = im.cpu().numpy() # torch to numpy
|
526
|
+
y = self.session.run(self.output_names, {self.session.get_inputs()[0].name: im})
|
527
|
+
else:
|
528
|
+
if not self.cuda:
|
529
|
+
im = im.cpu()
|
530
|
+
self.io.bind_input(
|
531
|
+
name="images",
|
532
|
+
device_type=im.device.type,
|
533
|
+
device_id=im.device.index if im.device.type == "cuda" else 0,
|
534
|
+
element_type=np.float16 if self.fp16 else np.float32,
|
535
|
+
shape=tuple(im.shape),
|
536
|
+
buffer_ptr=im.data_ptr(),
|
537
|
+
)
|
538
|
+
self.session.run_with_iobinding(self.io)
|
539
|
+
y = self.bindings
|
482
540
|
|
483
541
|
# OpenVINO
|
484
542
|
elif self.xml:
|
@@ -554,6 +612,12 @@ class AutoBackend(nn.Module):
|
|
554
612
|
self.predictor.run()
|
555
613
|
y = [self.predictor.get_output_handle(x).copy_to_cpu() for x in self.output_names]
|
556
614
|
|
615
|
+
# MNN
|
616
|
+
elif self.mnn:
|
617
|
+
input_var = self.torch_to_mnn(im)
|
618
|
+
output_var = self.net.onForward([input_var])
|
619
|
+
y = [x.read() for x in output_var]
|
620
|
+
|
557
621
|
# NCNN
|
558
622
|
elif self.ncnn:
|
559
623
|
mat_in = self.pyncnn.Mat(im[0].cpu().numpy())
|
@@ -599,6 +663,9 @@ class AutoBackend(nn.Module):
|
|
599
663
|
else:
|
600
664
|
x[:, [0, 2]] *= w
|
601
665
|
x[:, [1, 3]] *= h
|
666
|
+
if self.task == "pose":
|
667
|
+
x[:, 5::3] *= w
|
668
|
+
x[:, 6::3] *= h
|
602
669
|
y.append(x)
|
603
670
|
# TF segment fixes: export is reversed vs ONNX export and protos are transposed
|
604
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)
|
ultralytics/utils/benchmarks.py
CHANGED
@@ -21,6 +21,7 @@ TensorFlow Lite | `tflite` | yolov8n.tflite
|
|
21
21
|
TensorFlow Edge TPU | `edgetpu` | yolov8n_edgetpu.tflite
|
22
22
|
TensorFlow.js | `tfjs` | yolov8n_web_model/
|
23
23
|
PaddlePaddle | `paddle` | yolov8n_paddle_model/
|
24
|
+
MNN | `mnn` | yolov8n.mnn
|
24
25
|
NCNN | `ncnn` | yolov8n_ncnn_model/
|
25
26
|
"""
|
26
27
|
|
@@ -111,8 +112,8 @@ def benchmark(
|
|
111
112
|
assert not isinstance(model, YOLOWorld), "YOLOWorldv2 Paddle exports not supported yet"
|
112
113
|
assert not is_end2end, "End-to-end models not supported by PaddlePaddle yet"
|
113
114
|
assert LINUX or MACOS, "Windows Paddle exports not supported yet"
|
114
|
-
if i in {12}: # NCNN
|
115
|
-
assert not isinstance(model, YOLOWorld), "YOLOWorldv2 NCNN exports not supported yet"
|
115
|
+
if i in {12, 13}: # MNN, NCNN
|
116
|
+
assert not isinstance(model, YOLOWorld), "YOLOWorldv2 MNN, NCNN exports not supported yet"
|
116
117
|
if "cpu" in device.type:
|
117
118
|
assert cpu, "inference not supported on CPU"
|
118
119
|
if "cuda" in device.type:
|
@@ -132,7 +133,7 @@ def benchmark(
|
|
132
133
|
assert model.task != "pose" or i != 7, "GraphDef Pose inference is not supported"
|
133
134
|
assert i not in {9, 10}, "inference not supported" # Edge TPU and TF.js are unsupported
|
134
135
|
assert i != 5 or platform.system() == "Darwin", "inference only supported on macOS>=10.13" # CoreML
|
135
|
-
if i in {
|
136
|
+
if i in {13}:
|
136
137
|
assert not is_end2end, "End-to-end torch.topk operation is not supported for NCNN prediction yet"
|
137
138
|
exported_model.predict(ASSETS / "bus.jpg", imgsz=imgsz, device=device, half=half)
|
138
139
|
|
ultralytics/utils/tuner.py
CHANGED
@@ -1,13 +1,16 @@
|
|
1
1
|
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
2
2
|
|
3
|
-
import subprocess
|
4
|
-
|
5
3
|
from ultralytics.cfg import TASK2DATA, TASK2METRIC, get_save_dir
|
6
4
|
from ultralytics.utils import DEFAULT_CFG, DEFAULT_CFG_DICT, LOGGER, NUM_THREADS, checks
|
7
5
|
|
8
6
|
|
9
7
|
def run_ray_tune(
|
10
|
-
model,
|
8
|
+
model,
|
9
|
+
space: dict = None,
|
10
|
+
grace_period: int = 10,
|
11
|
+
gpu_per_trial: int = None,
|
12
|
+
max_samples: int = 10,
|
13
|
+
**train_args,
|
11
14
|
):
|
12
15
|
"""
|
13
16
|
Runs hyperparameter tuning using Ray Tune.
|
@@ -39,7 +42,7 @@ def run_ray_tune(
|
|
39
42
|
train_args = {}
|
40
43
|
|
41
44
|
try:
|
42
|
-
|
45
|
+
checks.check_requirements("ray[tune]")
|
43
46
|
|
44
47
|
import ray
|
45
48
|
from ray import tune
|
@@ -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
|
@@ -86,10 +86,10 @@ ultralytics/cfg/models/v9/yolov9m.yaml,sha256=l6CmivzNu44sRVmkQXk4-tXflbV1nWnk5M
|
|
86
86
|
ultralytics/cfg/models/v9/yolov9s.yaml,sha256=lPWcu-6ub1kCBD6zIDFwthYZ3RvdJfODWKy3vEQWRjo,1291
|
87
87
|
ultralytics/cfg/models/v9/yolov9t.yaml,sha256=qL__kr6GoefpQWP4jV0jdzwTp46bdFUcqtPRnfDbkY8,1275
|
88
88
|
ultralytics/cfg/solutions/default.yaml,sha256=irtGM8nxaSBkrWMqcXoJdtKgqAq1YBwyVMGx5csSH2Y,1239
|
89
|
-
ultralytics/cfg/trackers/botsort.yaml,sha256=
|
90
|
-
ultralytics/cfg/trackers/bytetrack.yaml,sha256=
|
89
|
+
ultralytics/cfg/trackers/botsort.yaml,sha256=FDIrZ3hAhRtMfDl654pt1HIexmPqlFQK-3lQ4D0tF84,918
|
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
|
@@ -99,13 +99,13 @@ ultralytics/data/loaders.py,sha256=Fr70Q9p9t7buLW_8R2_lI_nyCMG033gWSxvwy1M-a-U,2
|
|
99
99
|
ultralytics/data/split_dota.py,sha256=eFafJ7Vg52wj6KDCHFJAf1tKzyPD5YaPB8kM4VX5Aeg,10688
|
100
100
|
ultralytics/data/utils.py,sha256=bmWEIrdogj4kssZQSJdSbIF8QsJU00lo-EY-Mgcqv4M,31073
|
101
101
|
ultralytics/engine/__init__.py,sha256=mHtJuK4hwF8cuV-VHDc7tp6u6D1gHz2Z7JI8grmQDTs,42
|
102
|
-
ultralytics/engine/exporter.py,sha256=
|
102
|
+
ultralytics/engine/exporter.py,sha256=atCOVnXPrN66xq1rbOTZFBQmY00qpveLrZ_C86DDZSc,60194
|
103
103
|
ultralytics/engine/model.py,sha256=pvL1uf-wwdWL8Iph7VEAYn1-z7wEHzVug21V_0_gO6M,51456
|
104
|
-
ultralytics/engine/predictor.py,sha256=
|
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
|
-
ultralytics/engine/validator.py,sha256=
|
108
|
+
ultralytics/engine/validator.py,sha256=aWpXE3nrOqaA7jCuUgwxi0FabiGTIXtZvjoJyCX903o,14870
|
109
109
|
ultralytics/hub/__init__.py,sha256=c6Me4E8V-P7mtzTggyPYz9FnVkqWRyPp9F-fMcyFNQ0,5632
|
110
110
|
ultralytics/hub/auth.py,sha256=pj_2NijotQpyG4_VJ6EAzNWGD93L6t-34J60yfiNZPc,5541
|
111
111
|
ultralytics/hub/session.py,sha256=2KznO5kX14HFZ2-Ct9LoG312sdHuigQSLZb58MGvbJY,16411
|
@@ -136,7 +136,7 @@ ultralytics/models/sam/modules/blocks.py,sha256=Q-KwhFbdyZhl1tjG_kP2LcQkZbzoNt61
|
|
136
136
|
ultralytics/models/sam/modules/decoders.py,sha256=mODsqnTN_CjE3H0Sh9cd8PfTnHANPjGB1bjqHxfezSg,25830
|
137
137
|
ultralytics/models/sam/modules/encoders.py,sha256=Ay3sYeUonCf6URXBdB0dDwyngovevW8hUDgULRnNIoA,34824
|
138
138
|
ultralytics/models/sam/modules/memory_attention.py,sha256=XilWBnRfH8wZxIoL2-yEk-dRypCsS0Jf_9t8WJxXKg0,9722
|
139
|
-
ultralytics/models/sam/modules/sam.py,sha256=
|
139
|
+
ultralytics/models/sam/modules/sam.py,sha256=H0EJpbwwYUJ-Hx4d_5OVCH0rZInmS937cu1183lzpcc,53102
|
140
140
|
ultralytics/models/sam/modules/tiny_encoder.py,sha256=NyzeFMLnmqwcFQFs-JBM9PCWSsYoYZ_6h59Un1DeDV0,41332
|
141
141
|
ultralytics/models/sam/modules/transformer.py,sha256=nuhF_14LGrr5uYCAP9XCXps-zlVcT4OWO0evXWDxPwI,16081
|
142
142
|
ultralytics/models/sam/modules/utils.py,sha256=Y36V6BVy6GeaAvKE8gHmoDIa-f5LjJpmSVwywNkv2yk,12315
|
@@ -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
|
@@ -200,7 +200,7 @@ ultralytics/trackers/utils/kalman_filter.py,sha256=cH9zD3fwkuezP97H9mw8cSBN7a8hH
|
|
200
200
|
ultralytics/trackers/utils/matching.py,sha256=3Ie1WNNRZ4_q3365F03XD7Nr9juZB_08mw4yUKC3w74,7162
|
201
201
|
ultralytics/utils/__init__.py,sha256=oUtiHZUVtz-KtequUv15Has85k2BHgP6c-_cAAdf-rM,49060
|
202
202
|
ultralytics/utils/autobatch.py,sha256=BO9MCRtrLDtrDQaxqV0BdjaYsgXf-q07Y3_VdGp4URY,4330
|
203
|
-
ultralytics/utils/benchmarks.py,sha256=
|
203
|
+
ultralytics/utils/benchmarks.py,sha256=UVjTO1gRCNVdk1-meSeNAh050nWhIR7i5E3ZjRcdyPk,25177
|
204
204
|
ultralytics/utils/checks.py,sha256=cEQIYK3ZGQqcQ9uckNF-KbYdjGpfA1FHJHsUim94EoA,29800
|
205
205
|
ultralytics/utils/dist.py,sha256=NDFga-uKxkBX2zLxFHSene_cCiGQJoyOeCXcN9JIOIk,2358
|
206
206
|
ultralytics/utils/downloads.py,sha256=fh7I5toTSowAOXtmx5zIzCEDREfTFG45cLIHmsDmuYw,21974
|
@@ -215,7 +215,7 @@ ultralytics/utils/plotting.py,sha256=TKtdbAOl6gZdFD2hlA5T4LNWfr2LUWbCC-cXkgL1JAU
|
|
215
215
|
ultralytics/utils/tal.py,sha256=ECsu95xEqOItmxMDN4YTD3FsUiIsQNWy0pZC3TfvFfk,16877
|
216
216
|
ultralytics/utils/torch_utils.py,sha256=91fmJtZRvIVb6LI-wNkNrlHE7mMNBmcR4oif8ZYppYU,30089
|
217
217
|
ultralytics/utils/triton.py,sha256=gg1finxno_tY2Ge9PMhmu7PI9wvoFZoiicdT4Bhqv3w,3936
|
218
|
-
ultralytics/utils/tuner.py,sha256=
|
218
|
+
ultralytics/utils/tuner.py,sha256=K09-z5k1E4ZriSKoWdwQrJ2PJ2fY1ez3-b2R6aKPTqM,6198
|
219
219
|
ultralytics/utils/callbacks/__init__.py,sha256=YrWqC3BVVaTLob4iCPR6I36mUxIUOpPJW7B_LjT78Qw,214
|
220
220
|
ultralytics/utils/callbacks/base.py,sha256=PHjQ6RITwC2dylCQTB0bdPgAsHjxVeuDb5N1NPTbHGc,5775
|
221
221
|
ultralytics/utils/callbacks/clearml.py,sha256=qbLbqzMVWAnjqg5YUM-Ue6CmGueFCvqKpHFKlw-MyVc,5933
|
@@ -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
|