dgenerate-ultralytics-headless 8.3.240__py3-none-any.whl → 8.3.241__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.
- {dgenerate_ultralytics_headless-8.3.240.dist-info → dgenerate_ultralytics_headless-8.3.241.dist-info}/METADATA +2 -2
- {dgenerate_ultralytics_headless-8.3.240.dist-info → dgenerate_ultralytics_headless-8.3.241.dist-info}/RECORD +11 -11
- ultralytics/__init__.py +1 -1
- ultralytics/engine/exporter.py +2 -1
- ultralytics/nn/autobackend.py +44 -38
- ultralytics/utils/__init__.py +1 -0
- ultralytics/utils/plotting.py +2 -0
- {dgenerate_ultralytics_headless-8.3.240.dist-info → dgenerate_ultralytics_headless-8.3.241.dist-info}/WHEEL +0 -0
- {dgenerate_ultralytics_headless-8.3.240.dist-info → dgenerate_ultralytics_headless-8.3.241.dist-info}/entry_points.txt +0 -0
- {dgenerate_ultralytics_headless-8.3.240.dist-info → dgenerate_ultralytics_headless-8.3.241.dist-info}/licenses/LICENSE +0 -0
- {dgenerate_ultralytics_headless-8.3.240.dist-info → dgenerate_ultralytics_headless-8.3.241.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dgenerate-ultralytics-headless
|
|
3
|
-
Version: 8.3.
|
|
3
|
+
Version: 8.3.241
|
|
4
4
|
Summary: Automatically built Ultralytics package with python-opencv-headless dependency instead of python-opencv
|
|
5
5
|
Author-email: Glenn Jocher <glenn.jocher@ultralytics.com>, Jing Qiu <jing.qiu@ultralytics.com>
|
|
6
6
|
Maintainer-email: Ultralytics <hello@ultralytics.com>
|
|
@@ -51,7 +51,7 @@ Requires-Dist: pytest; extra == "dev"
|
|
|
51
51
|
Requires-Dist: pytest-cov; extra == "dev"
|
|
52
52
|
Requires-Dist: coverage[toml]; extra == "dev"
|
|
53
53
|
Requires-Dist: zensical>=0.0.9; python_version >= "3.10" and extra == "dev"
|
|
54
|
-
Requires-Dist: mkdocs-ultralytics-plugin>=0.2.
|
|
54
|
+
Requires-Dist: mkdocs-ultralytics-plugin>=0.2.4; extra == "dev"
|
|
55
55
|
Requires-Dist: minijinja>=2.0.0; extra == "dev"
|
|
56
56
|
Provides-Extra: export
|
|
57
57
|
Requires-Dist: numpy<2.0.0; extra == "export"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
dgenerate_ultralytics_headless-8.3.
|
|
1
|
+
dgenerate_ultralytics_headless-8.3.241.dist-info/licenses/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
|
2
2
|
tests/__init__.py,sha256=bCox_hLdGRFYGLb2kd722VdNP2zEXNYNuLLYtqZSrbw,804
|
|
3
3
|
tests/conftest.py,sha256=mOy9lGpNp7lk1hHl6_pVE0f9cU-72gnkoSm4TO-CNZU,2318
|
|
4
4
|
tests/test_cli.py,sha256=GhIFHi-_WIJpDgoGNRi0DnjbfwP1wHbklBMnkCM-P_4,5464
|
|
@@ -8,7 +8,7 @@ tests/test_exports.py,sha256=8dxll33sqhlHeWplly5xxSdT-Nqw2cRRZWN3jZeRWWc,14155
|
|
|
8
8
|
tests/test_integrations.py,sha256=6QgSh9n0J04RdUYz08VeVOnKmf4S5MDEQ0chzS7jo_c,6220
|
|
9
9
|
tests/test_python.py,sha256=viMvRajIbDZdm64hRRg9i8qZ1sU9frwB69e56mxwEXk,29266
|
|
10
10
|
tests/test_solutions.py,sha256=CIaphpmOXgz9AE9xcm1RWODKrwGfZLCc84IggGXArNM,14122
|
|
11
|
-
ultralytics/__init__.py,sha256=
|
|
11
|
+
ultralytics/__init__.py,sha256=S3XtXs_EbjQDpks7nIo7kSOhs1K6f8di-vl6nLmJ6_g,1302
|
|
12
12
|
ultralytics/py.typed,sha256=la67KBlbjXN-_-DfGNcdOcjYumVpKG_Tkw-8n5dnGB4,8
|
|
13
13
|
ultralytics/assets/bus.jpg,sha256=wCAZxJecGR63Od3ZRERe9Aja1Weayrb9Ug751DS_vGM,137419
|
|
14
14
|
ultralytics/assets/zidane.jpg,sha256=Ftc4aeMmen1O0A3o6GCDO9FlfBslLpTAw0gnetx7bts,50427
|
|
@@ -123,7 +123,7 @@ ultralytics/data/scripts/get_coco.sh,sha256=UuJpJeo3qQpTHVINeOpmP0NYmg8PhEFE3A8J
|
|
|
123
123
|
ultralytics/data/scripts/get_coco128.sh,sha256=qmRQl_hOKrsdHrTrnyQuFIH01oDz3lfaz138OgGfLt8,650
|
|
124
124
|
ultralytics/data/scripts/get_imagenet.sh,sha256=hr42H16bM47iT27rgS7MpEo-GeOZAYUQXgr0B2cwn48,1705
|
|
125
125
|
ultralytics/engine/__init__.py,sha256=lm6MckFYCPTbqIoX7w0s_daxdjNeBeKW6DXppv1-QUM,70
|
|
126
|
-
ultralytics/engine/exporter.py,sha256=
|
|
126
|
+
ultralytics/engine/exporter.py,sha256=XG7JOdeJb_4pQF-iQkf1pCTCsFn_VVLILhBI_wu-iPM,73038
|
|
127
127
|
ultralytics/engine/model.py,sha256=RkjMWXkyGmYjmMYIG8mPX8Cf1cJvn0ccOsXt03g7tIk,52999
|
|
128
128
|
ultralytics/engine/predictor.py,sha256=neYmNDX27Vv3ggk9xqaKlH6XzB2vlFIghU5o7ZC0zFo,22838
|
|
129
129
|
ultralytics/engine/results.py,sha256=LHX0AaVOv3CEjYjw8i4LThXqihxmahWCxpH20b4s9dM,68030
|
|
@@ -210,7 +210,7 @@ ultralytics/models/yolo/yoloe/train.py,sha256=giX6zDu5Z3z48PCaBHzu7v9NH3BrpUaGAY
|
|
|
210
210
|
ultralytics/models/yolo/yoloe/train_seg.py,sha256=0hRByMXsEJA-J2B1wXDMVhiW9f9MOTj3LlrGTibN6Ww,4919
|
|
211
211
|
ultralytics/models/yolo/yoloe/val.py,sha256=utUFWeFKRFWZrPr1y3A8ztbTwdoWMYqzlwBN7CQ0tCA,9418
|
|
212
212
|
ultralytics/nn/__init__.py,sha256=538LZPUKKvc3JCMgiQ4VLGqRN2ZAaVLFcQbeNNHFkEA,545
|
|
213
|
-
ultralytics/nn/autobackend.py,sha256=
|
|
213
|
+
ultralytics/nn/autobackend.py,sha256=mCPRyW3OGt_jzi1dwAJXH93ntsHqg_95AfSjWhjt-cw,44612
|
|
214
214
|
ultralytics/nn/tasks.py,sha256=636MN27VvlupIaHPpV4r0J705RUdV-giNKjIeJbRkxI,70448
|
|
215
215
|
ultralytics/nn/text_model.py,sha256=novnuosqXnW1NmlOzWOk7dEKuN6Vq40CTksr6hI3Knc,15109
|
|
216
216
|
ultralytics/nn/modules/__init__.py,sha256=5Sg_28MDfKwdu14Ty_WCaiIXZyjBSQ-xCNCwnoz_w-w,3198
|
|
@@ -250,7 +250,7 @@ ultralytics/trackers/utils/__init__.py,sha256=lm6MckFYCPTbqIoX7w0s_daxdjNeBeKW6D
|
|
|
250
250
|
ultralytics/trackers/utils/gmc.py,sha256=cvvhNXOhylVQti4pJQSNPx4yPqhhhw1k2yzY0JFl7Zo,13760
|
|
251
251
|
ultralytics/trackers/utils/kalman_filter.py,sha256=crgysL2bo0v1eTljOlP2YqIJDLBcHjl75MRpbxfaR_M,21514
|
|
252
252
|
ultralytics/trackers/utils/matching.py,sha256=jRZQrYSECQEwILn3mr7OodB8o7GawV-1v869plHstwk,7147
|
|
253
|
-
ultralytics/utils/__init__.py,sha256=
|
|
253
|
+
ultralytics/utils/__init__.py,sha256=JfvODTB4mG_JOhTeCiPtq0iCEgiCh14hJf195rnOhLQ,55145
|
|
254
254
|
ultralytics/utils/autobatch.py,sha256=jiE4m_--H9UkXFDm_FqzcZk_hSTCGpS72XdVEKgZwAo,5114
|
|
255
255
|
ultralytics/utils/autodevice.py,sha256=rXlPuo-iX-vZ4BabmMGEGh9Uxpau4R7Zlt1KCo9Xfyc,8892
|
|
256
256
|
ultralytics/utils/benchmarks.py,sha256=S_W4S4pe2ktSRdSuWb6m09UEFQmZhmjl943bbo67hOI,32277
|
|
@@ -269,7 +269,7 @@ ultralytics/utils/metrics.py,sha256=pP1LoKweL3Iga5dvCBVoqMSi5TwaaHERKKugDUloUs8,
|
|
|
269
269
|
ultralytics/utils/nms.py,sha256=zv1rOzMF6WU8Kdk41VzNf1H1EMt_vZHcbDFbg3mnN2o,14248
|
|
270
270
|
ultralytics/utils/ops.py,sha256=Se_Vb_smotVZ4g9gW4x56LpflAmbNDCEaeQz5BmUiD0,25637
|
|
271
271
|
ultralytics/utils/patches.py,sha256=mD3slAMAhcezzP42_fOWmacNMU6zXB68Br4_EBCyIjs,7117
|
|
272
|
-
ultralytics/utils/plotting.py,sha256=
|
|
272
|
+
ultralytics/utils/plotting.py,sha256=nLProk2U3xYBwV4CdkeBx1mrPnrPA550cNSQRGbcLsg,48368
|
|
273
273
|
ultralytics/utils/tal.py,sha256=w7oi6fp0NmL6hHh-yvCCX1cBuuB4JuX7w1wiR4_SMZs,20678
|
|
274
274
|
ultralytics/utils/torch_utils.py,sha256=zOPUQlorTiEPSkqlSEPyaQhpmzmgOIKF7f3xJb0UjdQ,40268
|
|
275
275
|
ultralytics/utils/tqdm.py,sha256=5PtGvRE9Xq8qugWqBSvZefAoFOnv3S0snETo5Z_ohNE,16185
|
|
@@ -291,8 +291,8 @@ ultralytics/utils/export/__init__.py,sha256=Cfh-PwVfTF_lwPp-Ss4wiX4z8Sm1XRPklsqd
|
|
|
291
291
|
ultralytics/utils/export/engine.py,sha256=23-lC6dNsmz5vprSJzaN7UGNXrFlVedNcqhlOH_IXes,9956
|
|
292
292
|
ultralytics/utils/export/imx.py,sha256=UHIq_PObOphIxctgSi0-5WaHvolHsHd3r5TTSjQSdgo,12860
|
|
293
293
|
ultralytics/utils/export/tensorflow.py,sha256=igYzwbdblb9YgfV4Jgl5lMvynuVRcF51dAzI7j-BBI0,9966
|
|
294
|
-
dgenerate_ultralytics_headless-8.3.
|
|
295
|
-
dgenerate_ultralytics_headless-8.3.
|
|
296
|
-
dgenerate_ultralytics_headless-8.3.
|
|
297
|
-
dgenerate_ultralytics_headless-8.3.
|
|
298
|
-
dgenerate_ultralytics_headless-8.3.
|
|
294
|
+
dgenerate_ultralytics_headless-8.3.241.dist-info/METADATA,sha256=9qvOTFpuIuFvwutj2DJnpJkcuGoXmoIulGzzZ-e6gw8,38798
|
|
295
|
+
dgenerate_ultralytics_headless-8.3.241.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
296
|
+
dgenerate_ultralytics_headless-8.3.241.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
|
|
297
|
+
dgenerate_ultralytics_headless-8.3.241.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
|
|
298
|
+
dgenerate_ultralytics_headless-8.3.241.dist-info/RECORD,,
|
ultralytics/__init__.py
CHANGED
ultralytics/engine/exporter.py
CHANGED
|
@@ -1205,8 +1205,9 @@ class Exporter:
|
|
|
1205
1205
|
# Setuptools bug: https://github.com/pypa/setuptools/issues/4483
|
|
1206
1206
|
check_requirements("setuptools<71.0.0") # Setuptools bug: https://github.com/pypa/setuptools/issues/4483
|
|
1207
1207
|
check_requirements(("executorch==1.0.1", "flatbuffers"))
|
|
1208
|
+
# Pin numpy to avoid coremltools errors with numpy>=2.4.0, must be separate
|
|
1209
|
+
check_requirements("numpy<=2.3.5")
|
|
1208
1210
|
|
|
1209
|
-
import torch
|
|
1210
1211
|
from executorch.backends.xnnpack.partition.xnnpack_partitioner import XnnpackPartitioner
|
|
1211
1212
|
from executorch.exir import to_edge_transform_and_lower
|
|
1212
1213
|
|
ultralytics/nn/autobackend.py
CHANGED
|
@@ -245,15 +245,20 @@ class AutoBackend(nn.Module):
|
|
|
245
245
|
check_requirements(("onnx", "onnxruntime-gpu" if cuda else "onnxruntime"))
|
|
246
246
|
import onnxruntime
|
|
247
247
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
248
|
+
# Select execution provider: CUDA > CoreML (mps) > CPU
|
|
249
|
+
available = onnxruntime.get_available_providers()
|
|
250
|
+
if cuda and "CUDAExecutionProvider" in available:
|
|
251
|
+
providers = [("CUDAExecutionProvider", {"device_id": device.index}), "CPUExecutionProvider"]
|
|
252
|
+
elif device.type == "mps" and "CoreMLExecutionProvider" in available:
|
|
253
|
+
providers = ["CoreMLExecutionProvider", "CPUExecutionProvider"]
|
|
254
|
+
else:
|
|
255
|
+
providers = ["CPUExecutionProvider"]
|
|
256
|
+
if cuda:
|
|
257
|
+
LOGGER.warning("CUDA requested but CUDAExecutionProvider not available. Using CPU...")
|
|
258
|
+
device, cuda = torch.device("cpu"), False
|
|
259
|
+
LOGGER.info(
|
|
260
|
+
f"Using ONNX Runtime {onnxruntime.__version__} with {providers[0] if isinstance(providers[0], str) else providers[0][0]}"
|
|
261
|
+
)
|
|
257
262
|
if onnx:
|
|
258
263
|
session = onnxruntime.InferenceSession(w, providers=providers)
|
|
259
264
|
else:
|
|
@@ -271,7 +276,10 @@ class AutoBackend(nn.Module):
|
|
|
271
276
|
metadata = session.get_modelmeta().custom_metadata_map
|
|
272
277
|
dynamic = isinstance(session.get_outputs()[0].shape[0], str)
|
|
273
278
|
fp16 = "float16" in session.get_inputs()[0].type
|
|
274
|
-
|
|
279
|
+
|
|
280
|
+
# Setup IO binding for optimized inference (CUDA only, not supported for CoreML)
|
|
281
|
+
use_io_binding = not dynamic and cuda
|
|
282
|
+
if use_io_binding:
|
|
275
283
|
io = session.io_binding()
|
|
276
284
|
bindings = []
|
|
277
285
|
for output in session.get_outputs():
|
|
@@ -371,32 +379,33 @@ class AutoBackend(nn.Module):
|
|
|
371
379
|
is_trt10 = not hasattr(model, "num_bindings")
|
|
372
380
|
num = range(model.num_io_tensors) if is_trt10 else range(model.num_bindings)
|
|
373
381
|
for i in num:
|
|
382
|
+
# Get tensor info using TRT10+ or legacy API
|
|
374
383
|
if is_trt10:
|
|
375
384
|
name = model.get_tensor_name(i)
|
|
376
385
|
dtype = trt.nptype(model.get_tensor_dtype(name))
|
|
377
386
|
is_input = model.get_tensor_mode(name) == trt.TensorIOMode.INPUT
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
context.set_input_shape(name, tuple(model.get_tensor_profile_shape(name, 0)[2]))
|
|
382
|
-
if dtype == np.float16:
|
|
383
|
-
fp16 = True
|
|
384
|
-
else:
|
|
385
|
-
output_names.append(name)
|
|
386
|
-
shape = tuple(context.get_tensor_shape(name))
|
|
387
|
-
else: # TensorRT < 10.0
|
|
387
|
+
shape = tuple(model.get_tensor_shape(name))
|
|
388
|
+
profile_shape = tuple(model.get_tensor_profile_shape(name, 0)[2]) if is_input else None
|
|
389
|
+
else:
|
|
388
390
|
name = model.get_binding_name(i)
|
|
389
391
|
dtype = trt.nptype(model.get_binding_dtype(i))
|
|
390
392
|
is_input = model.binding_is_input(i)
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
393
|
+
shape = tuple(model.get_binding_shape(i))
|
|
394
|
+
profile_shape = tuple(model.get_profile_shape(0, i)[1]) if is_input else None
|
|
395
|
+
|
|
396
|
+
# Process input/output tensors
|
|
397
|
+
if is_input:
|
|
398
|
+
if -1 in shape:
|
|
399
|
+
dynamic = True
|
|
400
|
+
if is_trt10:
|
|
401
|
+
context.set_input_shape(name, profile_shape)
|
|
402
|
+
else:
|
|
403
|
+
context.set_binding_shape(i, profile_shape)
|
|
404
|
+
if dtype == np.float16:
|
|
405
|
+
fp16 = True
|
|
406
|
+
else:
|
|
407
|
+
output_names.append(name)
|
|
408
|
+
shape = tuple(context.get_tensor_shape(name)) if is_trt10 else tuple(context.get_binding_shape(i))
|
|
400
409
|
im = torch.from_numpy(np.empty(shape, dtype=dtype)).to(device)
|
|
401
410
|
bindings[name] = Binding(name, dtype, shape, im, int(im.data_ptr()))
|
|
402
411
|
binding_addrs = OrderedDict((n, d.ptr) for n, d in bindings.items())
|
|
@@ -418,8 +427,7 @@ class AutoBackend(nn.Module):
|
|
|
418
427
|
LOGGER.info(f"Loading {w} for TensorFlow SavedModel inference...")
|
|
419
428
|
import tensorflow as tf
|
|
420
429
|
|
|
421
|
-
|
|
422
|
-
model = tf.keras.models.load_model(w) if keras else tf.saved_model.load(w)
|
|
430
|
+
model = tf.saved_model.load(w)
|
|
423
431
|
metadata = Path(w) / "metadata.yaml"
|
|
424
432
|
|
|
425
433
|
# TF GraphDef
|
|
@@ -699,10 +707,7 @@ class AutoBackend(nn.Module):
|
|
|
699
707
|
|
|
700
708
|
# ONNX Runtime
|
|
701
709
|
elif self.onnx or self.imx:
|
|
702
|
-
if self.
|
|
703
|
-
im = im.cpu().numpy() # torch to numpy
|
|
704
|
-
y = self.session.run(self.output_names, {self.session.get_inputs()[0].name: im})
|
|
705
|
-
else:
|
|
710
|
+
if self.use_io_binding:
|
|
706
711
|
if not self.cuda:
|
|
707
712
|
im = im.cpu()
|
|
708
713
|
self.io.bind_input(
|
|
@@ -715,6 +720,9 @@ class AutoBackend(nn.Module):
|
|
|
715
720
|
)
|
|
716
721
|
self.session.run_with_iobinding(self.io)
|
|
717
722
|
y = self.bindings
|
|
723
|
+
else:
|
|
724
|
+
im = im.cpu().numpy() # torch to numpy
|
|
725
|
+
y = self.session.run(self.output_names, {self.session.get_inputs()[0].name: im})
|
|
718
726
|
if self.imx:
|
|
719
727
|
if self.task == "detect":
|
|
720
728
|
# boxes, conf, cls
|
|
@@ -839,7 +847,7 @@ class AutoBackend(nn.Module):
|
|
|
839
847
|
else:
|
|
840
848
|
im = im.cpu().numpy()
|
|
841
849
|
if self.saved_model: # SavedModel
|
|
842
|
-
y = self.model
|
|
850
|
+
y = self.model.serving_default(im)
|
|
843
851
|
if not isinstance(y, list):
|
|
844
852
|
y = [y]
|
|
845
853
|
elif self.pb: # GraphDef
|
|
@@ -884,8 +892,6 @@ class AutoBackend(nn.Module):
|
|
|
884
892
|
y[1] = np.transpose(y[1], (0, 3, 1, 2)) # should be y = (1, 116, 8400), (1, 32, 160, 160)
|
|
885
893
|
y = [x if isinstance(x, np.ndarray) else x.numpy() for x in y]
|
|
886
894
|
|
|
887
|
-
# for x in y:
|
|
888
|
-
# print(type(x), len(x)) if isinstance(x, (list, tuple)) else print(type(x), x.shape) # debug shapes
|
|
889
895
|
if isinstance(y, (list, tuple)):
|
|
890
896
|
if len(self.names) == 999 and (self.task == "segment" or len(y) == 2): # segments and names not defined
|
|
891
897
|
nc = y[0].shape[1] - y[1].shape[1] - 4 # y = (1, 32, 160, 160), (1, 116, 8400)
|
ultralytics/utils/__init__.py
CHANGED
ultralytics/utils/plotting.py
CHANGED
|
@@ -203,6 +203,8 @@ class Annotator:
|
|
|
203
203
|
if not input_is_pil:
|
|
204
204
|
if im.shape[2] == 1: # handle grayscale
|
|
205
205
|
im = cv2.cvtColor(im, cv2.COLOR_GRAY2BGR)
|
|
206
|
+
elif im.shape[2] == 2: # handle 2-channel images
|
|
207
|
+
im = np.ascontiguousarray(np.dstack((im, np.zeros_like(im[..., :1]))))
|
|
206
208
|
elif im.shape[2] > 3: # multispectral
|
|
207
209
|
im = np.ascontiguousarray(im[..., :3])
|
|
208
210
|
if self.pil: # use PIL
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|