dgenerate-ultralytics-headless 8.3.193__py3-none-any.whl → 8.3.194__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.193.dist-info → dgenerate_ultralytics_headless-8.3.194.dist-info}/METADATA +1 -1
- {dgenerate_ultralytics_headless-8.3.193.dist-info → dgenerate_ultralytics_headless-8.3.194.dist-info}/RECORD +18 -17
- tests/test_exports.py +8 -5
- tests/test_python.py +1 -1
- ultralytics/__init__.py +1 -1
- ultralytics/engine/exporter.py +4 -4
- ultralytics/hub/__init__.py +1 -2
- ultralytics/hub/utils.py +0 -101
- ultralytics/models/sam/predict.py +3 -3
- ultralytics/nn/autobackend.py +8 -11
- ultralytics/utils/__init__.py +1 -2
- ultralytics/utils/callbacks/hub.py +2 -1
- ultralytics/utils/events.py +115 -0
- ultralytics/utils/ops.py +3 -1
- {dgenerate_ultralytics_headless-8.3.193.dist-info → dgenerate_ultralytics_headless-8.3.194.dist-info}/WHEEL +0 -0
- {dgenerate_ultralytics_headless-8.3.193.dist-info → dgenerate_ultralytics_headless-8.3.194.dist-info}/entry_points.txt +0 -0
- {dgenerate_ultralytics_headless-8.3.193.dist-info → dgenerate_ultralytics_headless-8.3.194.dist-info}/licenses/LICENSE +0 -0
- {dgenerate_ultralytics_headless-8.3.193.dist-info → dgenerate_ultralytics_headless-8.3.194.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.194
|
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>
|
@@ -1,14 +1,14 @@
|
|
1
|
-
dgenerate_ultralytics_headless-8.3.
|
1
|
+
dgenerate_ultralytics_headless-8.3.194.dist-info/licenses/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
2
2
|
tests/__init__.py,sha256=b4KP5_q-2IO8Br8YHOSLYnn7IwZS81l_vfEF2YPa2lM,894
|
3
3
|
tests/conftest.py,sha256=LXtQJcFNWPGuzauTGkiXgsvVC3llJKfg22WcmhRzuQc,2593
|
4
4
|
tests/test_cli.py,sha256=EMf5gTAopOnIz8VvzaM-Qb044o7D0flnUHYQ-2ffOM4,5670
|
5
5
|
tests/test_cuda.py,sha256=Z-MX1aIBQyt_fAAgKxBEznE0Mj7caSwrctW9z__NGzU,8240
|
6
6
|
tests/test_engine.py,sha256=Jpt2KVrltrEgh2-3Ykouz-2Z_2fza0eymL5ectRXadM,4922
|
7
|
-
tests/test_exports.py,sha256=
|
7
|
+
tests/test_exports.py,sha256=dWuroSyqXnrc0lE-RNTf7pZoXXXEkOs31u7nhOiEHS0,10994
|
8
8
|
tests/test_integrations.py,sha256=kl_AKmE_Qs1GB0_91iVwbzNxofm_hFTt0zzU6JF-pg4,6323
|
9
|
-
tests/test_python.py,sha256=
|
9
|
+
tests/test_python.py,sha256=FGZ2XabwLmXLcKTmsQHBBbxoVTCmk0B1ACcTWUBIUIo,27911
|
10
10
|
tests/test_solutions.py,sha256=6wJ9-lhyWSAm7zaR4D9L_DrUA3iJU1NgqmbQO6PIuvo,13211
|
11
|
-
ultralytics/__init__.py,sha256=
|
11
|
+
ultralytics/__init__.py,sha256=UXztbDjWj3KFSfHZL_6SgEbd4QY_ofQJ2YQxENZsaJA,730
|
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
|
@@ -121,17 +121,17 @@ ultralytics/data/scripts/get_coco.sh,sha256=UuJpJeo3qQpTHVINeOpmP0NYmg8PhEFE3A8J
|
|
121
121
|
ultralytics/data/scripts/get_coco128.sh,sha256=qmRQl_hOKrsdHrTrnyQuFIH01oDz3lfaz138OgGfLt8,650
|
122
122
|
ultralytics/data/scripts/get_imagenet.sh,sha256=hr42H16bM47iT27rgS7MpEo-GeOZAYUQXgr0B2cwn48,1705
|
123
123
|
ultralytics/engine/__init__.py,sha256=lm6MckFYCPTbqIoX7w0s_daxdjNeBeKW6DXppv1-QUM,70
|
124
|
-
ultralytics/engine/exporter.py,sha256=
|
124
|
+
ultralytics/engine/exporter.py,sha256=c7OXFm9qBliL9zVL5g8_hVp8dVwZd3L-MnwSZDPLVrw,75428
|
125
125
|
ultralytics/engine/model.py,sha256=q3rj1QmJoR4uYXb6dvn2dVRheEY8TzJhm9KznD_VDso,53488
|
126
126
|
ultralytics/engine/predictor.py,sha256=EzFcRzihNTYgdayviLwEk7pUOotNoEVbQtVFI18jNpM,22625
|
127
127
|
ultralytics/engine/results.py,sha256=115lVbiqzyho1fXm-YpqQBtKiv-Wo2FPNhz6ExYHtCk,71499
|
128
128
|
ultralytics/engine/trainer.py,sha256=_mTG-z6xnOdFUmB6uOF8HQkFb_uMwP0MrJHlt7X3zVw,40457
|
129
129
|
ultralytics/engine/tuner.py,sha256=XuqcjyGpD79pUVn-PXlJJGKXgH1yblPdYBH_R2kHWSU,20586
|
130
130
|
ultralytics/engine/validator.py,sha256=8ky0lcMCYDY7RGYRUowDAKxEMfsPBLpT7LlgfHA-IsY,16681
|
131
|
-
ultralytics/hub/__init__.py,sha256=
|
131
|
+
ultralytics/hub/__init__.py,sha256=xCF02lzlPKbdmGfO3NxLuXl5Kb0MaBZp_-fAWDHZ8zw,6698
|
132
132
|
ultralytics/hub/auth.py,sha256=RIwZDWfW6vS2yGpZKR0xVl0-38itJYEFtmqY_M70bl8,6304
|
133
133
|
ultralytics/hub/session.py,sha256=iz7HbxU63OHr-7bNm1QIKPVRQc-3lnXMbWH19bgFVfQ,18450
|
134
|
-
ultralytics/hub/utils.py,sha256=
|
134
|
+
ultralytics/hub/utils.py,sha256=19ZbwQuIumEb9JwdpUwDxmCZq1Ftm-7whU5yvGABvhY,6384
|
135
135
|
ultralytics/hub/google/__init__.py,sha256=-Hh4rUoQBdUFkPqnj7UeQUMdejVbbL8nFFrKAT5OxhE,8468
|
136
136
|
ultralytics/models/__init__.py,sha256=DqQFFYJ4IQlqIDb61H1HzcnZU7SuHN-43bw94-l-YAQ,309
|
137
137
|
ultralytics/models/fastsam/__init__.py,sha256=HGJ8EKlBAsdF-e2aIwQLjSDAFI_r0yHR0A1gzrp4vqE,231
|
@@ -152,7 +152,7 @@ ultralytics/models/sam/__init__.py,sha256=4VtjxrbrSsqBvteaD_CwA4Nj3DdSUG1MknymtW
|
|
152
152
|
ultralytics/models/sam/amg.py,sha256=07UkNkcbOUj3tc9L2H9rAuH5s1WDJLqX81kt2zbzDsw,11821
|
153
153
|
ultralytics/models/sam/build.py,sha256=J6n-_QOYLa63jldEZmhRe9D3Is_AJE8xyZLUjzfRyTY,12629
|
154
154
|
ultralytics/models/sam/model.py,sha256=rTBCWYoYDKvF34FY5RXhdTTSNa_fO4LjkJbIPgYh-L8,7237
|
155
|
-
ultralytics/models/sam/predict.py,sha256=
|
155
|
+
ultralytics/models/sam/predict.py,sha256=E6BrWPJw26ZS6Cv0IhdMhXllnx6XiNvTHfQlBJGrEr4,104963
|
156
156
|
ultralytics/models/sam/modules/__init__.py,sha256=lm6MckFYCPTbqIoX7w0s_daxdjNeBeKW6DXppv1-QUM,70
|
157
157
|
ultralytics/models/sam/modules/blocks.py,sha256=Wc6ThlZ5G3S8XJrH6WclbyzI3vIqWHKAWYb7n3A6Fdk,46055
|
158
158
|
ultralytics/models/sam/modules/decoders.py,sha256=Vc0nDC1Ex8RBxJX6j-RWRdkYQif0A4-0vtE13aeF8eA,25620
|
@@ -196,7 +196,7 @@ ultralytics/models/yolo/yoloe/train.py,sha256=lAb-5TgYA_Z6rwEYCMdPcfjJmCGYQqXE5I
|
|
196
196
|
ultralytics/models/yolo/yoloe/train_seg.py,sha256=aCV7M8oQOvODFnU4piZdJh3tIrBJYAzZfRVRx1vRgxo,4956
|
197
197
|
ultralytics/models/yolo/yoloe/val.py,sha256=MnS2YwhRxdqXPRlExHt-9HRp8KKIHuFdmiNH1z6LedI,9795
|
198
198
|
ultralytics/nn/__init__.py,sha256=PJgOn2phQTTBR2P3s_JWvGeGXQpvw1znsumKow4tCuE,545
|
199
|
-
ultralytics/nn/autobackend.py,sha256=
|
199
|
+
ultralytics/nn/autobackend.py,sha256=MJtvfT9tiJtlLQIp88wnSImMGxwCAqS6fNMZtMJe1ZA,41063
|
200
200
|
ultralytics/nn/tasks.py,sha256=tvoVVqVoMZuylLmUJNDs9eX4bdFbDibQKd3lJed5fYY,70470
|
201
201
|
ultralytics/nn/text_model.py,sha256=lserJWlXNzP31jB4xA-7gkbhB0VsMBGiE9G8wYpztvE,15275
|
202
202
|
ultralytics/nn/modules/__init__.py,sha256=BPMbEm1daI7Tuds3zph2_afAX7Gq1uAqK8BfiCfKTZs,3198
|
@@ -236,7 +236,7 @@ ultralytics/trackers/utils/__init__.py,sha256=lm6MckFYCPTbqIoX7w0s_daxdjNeBeKW6D
|
|
236
236
|
ultralytics/trackers/utils/gmc.py,sha256=a4WuIh976_GYogvlQEPKTNE59JNNtSNlT_IPrz4wmrM,14028
|
237
237
|
ultralytics/trackers/utils/kalman_filter.py,sha256=PPmM0lwBMdT_hGojvfLoUsBUFMBBMNRAxKbMcQa3wJ0,21619
|
238
238
|
ultralytics/trackers/utils/matching.py,sha256=uSYtywqi1lE_uNN1FwuBFPyISfDQXHMu8K5KH69nrRI,7160
|
239
|
-
ultralytics/utils/__init__.py,sha256=
|
239
|
+
ultralytics/utils/__init__.py,sha256=8vYownbjAVDmRc2cafLetRjcq-YsUcy1LPKmSrz5yuM,53204
|
240
240
|
ultralytics/utils/autobatch.py,sha256=i6KYLLSItKP1Q2IUlTPHrZhjcxl7UOjs0Seb8bF8pvM,5124
|
241
241
|
ultralytics/utils/autodevice.py,sha256=Od9SGx6xAQoX-3L62PS7I6xOxbbqjYLR4Wipgn5WoDc,8843
|
242
242
|
ultralytics/utils/benchmarks.py,sha256=zKI-DxEqaVmqlE2pg9p6j1kI7Efo1OyM1NnKubYpDU8,31458
|
@@ -244,6 +244,7 @@ ultralytics/utils/checks.py,sha256=WBuJKFiXGqf-5n0S_QNwRet3ZxVIFMdG0VPZSoOJwYM,3
|
|
244
244
|
ultralytics/utils/dist.py,sha256=A9lDGtGefTjSVvVS38w86GOdbtLzNBDZuDGK0MT4PRI,4170
|
245
245
|
ultralytics/utils/downloads.py,sha256=mLOLonKQsePC15sLVZJzGyLmD_TZPkL1T_qd0gUb4lA,23029
|
246
246
|
ultralytics/utils/errors.py,sha256=XT9Ru7ivoBgofK6PlnyigGoa7Fmf5nEhyHtnD-8TRXI,1584
|
247
|
+
ultralytics/utils/events.py,sha256=v2RmLlx78_K6xQfOAuUTJMOexAgNdiuiOvvnsH65oDA,4679
|
247
248
|
ultralytics/utils/export.py,sha256=xHBBDyI0hGQ1hbUi-uWnCgnFBES77nXqZFtgSrX0VXA,9838
|
248
249
|
ultralytics/utils/files.py,sha256=kxE2rkBuZL288nSN7jxLljmDnBgc16rekEXeRjhbUoo,8213
|
249
250
|
ultralytics/utils/git.py,sha256=DcaxKNQfCiG3cxdzuw7M6l_VXgaSVqkERQt_vl8UyXM,5512
|
@@ -252,7 +253,7 @@ ultralytics/utils/logger.py,sha256=o_vH4CCgQat6_Sbmwm1sUAJ4muAgVcsUed-WqpGNQZw,1
|
|
252
253
|
ultralytics/utils/loss.py,sha256=sC2efov3Uwg2eT5oOzMHRfnQLZvtGXSdMuWBTKxyxPw,39816
|
253
254
|
ultralytics/utils/metrics.py,sha256=9nykBkIy6soJebhc31UpaQghC4kz8e0qUpGpnr4yaGs,68809
|
254
255
|
ultralytics/utils/nms.py,sha256=wCRQ7O7shv5ccEWHgtF9Ky_vUeyumxFLWBFEj1h0U54,14199
|
255
|
-
ultralytics/utils/ops.py,sha256=
|
256
|
+
ultralytics/utils/ops.py,sha256=_qd_MY6IJQbhdihNvJCRe4Ws22awGrS2QUuRFdkk-EI,26886
|
256
257
|
ultralytics/utils/patches.py,sha256=j0fXwX3YqKrON7yrmSVkXsn__tsvs4qVuysH-hzcxOE,6541
|
257
258
|
ultralytics/utils/plotting.py,sha256=6iPtxQJ7JFTv2vWpSzP90plkksXhvql1EVQaKomkuiQ,47515
|
258
259
|
ultralytics/utils/tal.py,sha256=LrziY_ZHz4wln3oOnqAzgyPaXKoup17Sa103BpuaQFU,20935
|
@@ -265,15 +266,15 @@ ultralytics/utils/callbacks/base.py,sha256=dGir0vkJY4jjprW63e23Qy4kHUT5dOINPii6H
|
|
265
266
|
ultralytics/utils/callbacks/clearml.py,sha256=xr5mZT_cY6AY_drbdCXFt-Dp2fOjRELxLDhDoRhNPg8,6067
|
266
267
|
ultralytics/utils/callbacks/comet.py,sha256=t-O4Kc57wLFFEclyl6XJWAixrNle0mpZK5IEM__WoTY,25393
|
267
268
|
ultralytics/utils/callbacks/dvc.py,sha256=NV0DXMQ1B5Sk5fmh60QFUGkifrAz-vwit5qhdfsyqXc,7511
|
268
|
-
ultralytics/utils/callbacks/hub.py,sha256=
|
269
|
+
ultralytics/utils/callbacks/hub.py,sha256=fVLqqr3ZM6hoYFlVMEeejfq1MWDrkWCskPFOG3HGILQ,4159
|
269
270
|
ultralytics/utils/callbacks/mlflow.py,sha256=6K8I5zij1yq3TUW9c5BBQNqdzz3IXugQjwKoBOvV6ag,5344
|
270
271
|
ultralytics/utils/callbacks/neptune.py,sha256=j8pecmlcsM8FGzLKWoBw5xUsi5t8E5HuxY7TR5Um_O8,4612
|
271
272
|
ultralytics/utils/callbacks/platform.py,sha256=a7T_8htoBB0uX1WIc392UJnhDjxkRyQMvhPYKR6wUTU,2008
|
272
273
|
ultralytics/utils/callbacks/raytune.py,sha256=S6Bq16oQDQ8BQgnZzA0zJHGN_BBr8iAM_WtGoLiEcwg,1283
|
273
274
|
ultralytics/utils/callbacks/tensorboard.py,sha256=MDPBW7aDes-66OE6YqKXXvqA_EocjzEMHWGM-8z9vUQ,5281
|
274
275
|
ultralytics/utils/callbacks/wb.py,sha256=ngQO8EJ1kxJDF1YajScVtzBbm26jGuejA0uWeOyvf5A,7685
|
275
|
-
dgenerate_ultralytics_headless-8.3.
|
276
|
-
dgenerate_ultralytics_headless-8.3.
|
277
|
-
dgenerate_ultralytics_headless-8.3.
|
278
|
-
dgenerate_ultralytics_headless-8.3.
|
279
|
-
dgenerate_ultralytics_headless-8.3.
|
276
|
+
dgenerate_ultralytics_headless-8.3.194.dist-info/METADATA,sha256=oq51YJjYcvtWGhR3ImIeGQVbsoQUhyY9R6LEkLaXm7Y,38789
|
277
|
+
dgenerate_ultralytics_headless-8.3.194.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
278
|
+
dgenerate_ultralytics_headless-8.3.194.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
|
279
|
+
dgenerate_ultralytics_headless-8.3.194.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
|
280
|
+
dgenerate_ultralytics_headless-8.3.194.dist-info/RECORD,,
|
tests/test_exports.py
CHANGED
@@ -120,14 +120,16 @@ def test_export_torchscript_matrix(task, dynamic, int8, half, batch, nms):
|
|
120
120
|
@pytest.mark.skipif(not TORCH_1_9, reason="CoreML>=7.2 not supported with PyTorch<=1.8")
|
121
121
|
@pytest.mark.skipif(checks.IS_PYTHON_3_13, reason="CoreML not supported in Python 3.13")
|
122
122
|
@pytest.mark.parametrize(
|
123
|
-
"task, dynamic, int8, half, batch",
|
123
|
+
"task, dynamic, int8, half, nms, batch",
|
124
124
|
[ # generate all combinations except for exclusion cases
|
125
|
-
(task, dynamic, int8, half, batch)
|
126
|
-
for task, dynamic, int8, half, batch in product(
|
127
|
-
|
125
|
+
(task, dynamic, int8, half, nms, batch)
|
126
|
+
for task, dynamic, int8, half, nms, batch in product(
|
127
|
+
TASKS, [False], [True, False], [True, False], [True, False], [1]
|
128
|
+
)
|
129
|
+
if not (int8 and half) and not (task != "detect" and nms)
|
128
130
|
],
|
129
131
|
)
|
130
|
-
def test_export_coreml_matrix(task, dynamic, int8, half, batch):
|
132
|
+
def test_export_coreml_matrix(task, dynamic, int8, half, nms, batch):
|
131
133
|
"""Test YOLO export to CoreML format with various parameter configurations."""
|
132
134
|
file = YOLO(TASK2MODEL[task]).export(
|
133
135
|
format="coreml",
|
@@ -136,6 +138,7 @@ def test_export_coreml_matrix(task, dynamic, int8, half, batch):
|
|
136
138
|
int8=int8,
|
137
139
|
half=half,
|
138
140
|
batch=batch,
|
141
|
+
nms=nms,
|
139
142
|
)
|
140
143
|
YOLO(file)([SOURCE] * batch, imgsz=32) # exported model inference
|
141
144
|
shutil.rmtree(file) # cleanup
|
tests/test_python.py
CHANGED
ultralytics/__init__.py
CHANGED
ultralytics/engine/exporter.py
CHANGED
@@ -587,7 +587,7 @@ class Exporter:
|
|
587
587
|
"""Export YOLO model to ONNX format."""
|
588
588
|
requirements = ["onnx>=1.12.0"]
|
589
589
|
if self.args.simplify:
|
590
|
-
requirements += ["onnxslim
|
590
|
+
requirements += ["onnxslim>=0.1.67", "onnxruntime" + ("-gpu" if torch.cuda.is_available() else "")]
|
591
591
|
check_requirements(requirements)
|
592
592
|
import onnx # noqa
|
593
593
|
|
@@ -955,17 +955,17 @@ class Exporter:
|
|
955
955
|
try:
|
956
956
|
import tensorflow as tf # noqa
|
957
957
|
except ImportError:
|
958
|
-
check_requirements("tensorflow>=2.0.0")
|
958
|
+
check_requirements("tensorflow>=2.0.0,<=2.19.0")
|
959
959
|
import tensorflow as tf # noqa
|
960
960
|
check_requirements(
|
961
961
|
(
|
962
|
-
"tf_keras", # required by 'onnx2tf' package
|
962
|
+
"tf_keras<=2.19.0", # required by 'onnx2tf' package
|
963
963
|
"sng4onnx>=1.0.1", # required by 'onnx2tf' package
|
964
964
|
"onnx_graphsurgeon>=0.3.26", # required by 'onnx2tf' package
|
965
965
|
"ai-edge-litert>=1.2.0,<1.4.0", # required by 'onnx2tf' package
|
966
966
|
"onnx>=1.12.0",
|
967
967
|
"onnx2tf>=1.26.3",
|
968
|
-
"onnxslim
|
968
|
+
"onnxslim>=0.1.67",
|
969
969
|
"onnxruntime-gpu" if cuda else "onnxruntime",
|
970
970
|
"protobuf>=5",
|
971
971
|
),
|
ultralytics/hub/__init__.py
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
from ultralytics.data.utils import HUBDatasetStats
|
4
4
|
from ultralytics.hub.auth import Auth
|
5
5
|
from ultralytics.hub.session import HUBTrainingSession
|
6
|
-
from ultralytics.hub.utils import HUB_API_ROOT, HUB_WEB_ROOT, PREFIX
|
6
|
+
from ultralytics.hub.utils import HUB_API_ROOT, HUB_WEB_ROOT, PREFIX
|
7
7
|
from ultralytics.utils import LOGGER, SETTINGS, checks
|
8
8
|
|
9
9
|
__all__ = (
|
@@ -17,7 +17,6 @@ __all__ = (
|
|
17
17
|
"export_model",
|
18
18
|
"get_export",
|
19
19
|
"check_dataset",
|
20
|
-
"events",
|
21
20
|
)
|
22
21
|
|
23
22
|
|
ultralytics/hub/utils.py
CHANGED
@@ -1,31 +1,17 @@
|
|
1
1
|
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2
2
|
|
3
3
|
import os
|
4
|
-
import random
|
5
4
|
import threading
|
6
5
|
import time
|
7
|
-
from pathlib import Path
|
8
6
|
from typing import Any
|
9
7
|
|
10
|
-
from ultralytics import __version__
|
11
8
|
from ultralytics.utils import (
|
12
|
-
ARGV,
|
13
|
-
ENVIRONMENT,
|
14
|
-
GIT,
|
15
9
|
IS_COLAB,
|
16
|
-
IS_PIP_PACKAGE,
|
17
10
|
LOGGER,
|
18
|
-
ONLINE,
|
19
|
-
PYTHON_VERSION,
|
20
|
-
RANK,
|
21
|
-
SETTINGS,
|
22
|
-
TESTS_RUNNING,
|
23
11
|
TQDM,
|
24
12
|
TryExcept,
|
25
13
|
colorstr,
|
26
14
|
)
|
27
|
-
from ultralytics.utils.downloads import GITHUB_ASSETS_NAMES
|
28
|
-
from ultralytics.utils.torch_utils import get_cpu_info
|
29
15
|
|
30
16
|
HUB_API_ROOT = os.environ.get("ULTRALYTICS_HUB_API", "https://api.ultralytics.com")
|
31
17
|
HUB_WEB_ROOT = os.environ.get("ULTRALYTICS_HUB_WEB", "https://hub.ultralytics.com")
|
@@ -177,90 +163,3 @@ def smart_request(
|
|
177
163
|
threading.Thread(target=func, args=args, kwargs=kwargs, daemon=True).start()
|
178
164
|
else:
|
179
165
|
return func(*args, **kwargs)
|
180
|
-
|
181
|
-
|
182
|
-
class Events:
|
183
|
-
"""
|
184
|
-
A class for collecting anonymous event analytics.
|
185
|
-
|
186
|
-
Event analytics are enabled when sync=True in settings and disabled when sync=False. Run 'yolo settings' to see and
|
187
|
-
update settings.
|
188
|
-
|
189
|
-
Attributes:
|
190
|
-
url (str): The URL to send anonymous events.
|
191
|
-
events (list): List of collected events to be sent.
|
192
|
-
rate_limit (float): The rate limit in seconds for sending events.
|
193
|
-
t (float): Rate limit timer in seconds.
|
194
|
-
metadata (dict): A dictionary containing metadata about the environment.
|
195
|
-
enabled (bool): A flag to enable or disable Events based on certain conditions.
|
196
|
-
"""
|
197
|
-
|
198
|
-
url = "https://www.google-analytics.com/mp/collect?measurement_id=G-X8NCJYTQXM&api_secret=QLQrATrNSwGRFRLE-cbHJw"
|
199
|
-
|
200
|
-
def __init__(self):
|
201
|
-
"""Initialize the Events object with default values for events, rate_limit, and metadata."""
|
202
|
-
self.events = [] # events list
|
203
|
-
self.rate_limit = 30.0 # rate limit (seconds)
|
204
|
-
self.t = 0.0 # rate limit timer (seconds)
|
205
|
-
self.metadata = {
|
206
|
-
"cli": Path(ARGV[0]).name == "yolo",
|
207
|
-
"install": "git" if GIT.is_repo else "pip" if IS_PIP_PACKAGE else "other",
|
208
|
-
"python": PYTHON_VERSION.rsplit(".", 1)[0], # i.e. 3.13
|
209
|
-
"CPU": get_cpu_info(),
|
210
|
-
# "GPU": get_gpu_info(index=0) if cuda else None,
|
211
|
-
"version": __version__,
|
212
|
-
"env": ENVIRONMENT,
|
213
|
-
"session_id": round(random.random() * 1e15),
|
214
|
-
"engagement_time_msec": 1000,
|
215
|
-
}
|
216
|
-
self.enabled = (
|
217
|
-
SETTINGS["sync"]
|
218
|
-
and RANK in {-1, 0}
|
219
|
-
and not TESTS_RUNNING
|
220
|
-
and ONLINE
|
221
|
-
and (IS_PIP_PACKAGE or GIT.origin == "https://github.com/ultralytics/ultralytics.git")
|
222
|
-
)
|
223
|
-
|
224
|
-
def __call__(self, cfg, device=None):
|
225
|
-
"""
|
226
|
-
Attempt to add a new event to the events list and send events if the rate limit is reached.
|
227
|
-
|
228
|
-
Args:
|
229
|
-
cfg (IterableSimpleNamespace): The configuration object containing mode and task information.
|
230
|
-
device (torch.device | str, optional): The device type (e.g., 'cpu', 'cuda').
|
231
|
-
"""
|
232
|
-
if not self.enabled:
|
233
|
-
# Events disabled, do nothing
|
234
|
-
return
|
235
|
-
|
236
|
-
# Attempt to add to events
|
237
|
-
if len(self.events) < 25: # Events list limited to 25 events (drop any events past this)
|
238
|
-
params = {
|
239
|
-
**self.metadata,
|
240
|
-
"task": cfg.task,
|
241
|
-
"model": cfg.model if cfg.model in GITHUB_ASSETS_NAMES else "custom",
|
242
|
-
"device": str(device),
|
243
|
-
}
|
244
|
-
if cfg.mode == "export":
|
245
|
-
params["format"] = cfg.format
|
246
|
-
self.events.append({"name": cfg.mode, "params": params})
|
247
|
-
|
248
|
-
# Check rate limit
|
249
|
-
t = time.time()
|
250
|
-
if (t - self.t) < self.rate_limit:
|
251
|
-
# Time is under rate limiter, wait to send
|
252
|
-
return
|
253
|
-
|
254
|
-
# Time is over rate limiter, send now
|
255
|
-
data = {"client_id": SETTINGS["uuid"], "events": self.events} # SHA-256 anonymized UUID hash and events list
|
256
|
-
|
257
|
-
# POST equivalent to requests.post(self.url, json=data)
|
258
|
-
smart_request("post", self.url, json=data, retry=0, verbose=False)
|
259
|
-
|
260
|
-
# Reset events and rate limit timer
|
261
|
-
self.events = []
|
262
|
-
self.t = t
|
263
|
-
|
264
|
-
|
265
|
-
# Run below code on hub/utils init -------------------------------------------------------------------------------------
|
266
|
-
events = Events()
|
@@ -1761,7 +1761,7 @@ class SAM2DynamicInteractivePredictor(SAM2Predictor):
|
|
1761
1761
|
@smart_inference_mode()
|
1762
1762
|
def inference(
|
1763
1763
|
self,
|
1764
|
-
|
1764
|
+
im: torch.Tensor | np.ndarray,
|
1765
1765
|
bboxes: list[list[float]] | None = None,
|
1766
1766
|
masks: torch.Tensor | np.ndarray | None = None,
|
1767
1767
|
points: list[list[float]] | None = None,
|
@@ -1777,7 +1777,7 @@ class SAM2DynamicInteractivePredictor(SAM2Predictor):
|
|
1777
1777
|
When update_memory is False, it will only run inference on the provided image without updating the memory.
|
1778
1778
|
|
1779
1779
|
Args:
|
1780
|
-
|
1780
|
+
im (torch.Tensor | np.ndarray): The input image tensor or numpy array.
|
1781
1781
|
bboxes (List[List[float]] | None): Optional list of bounding boxes to update the memory.
|
1782
1782
|
masks (List[torch.Tensor | np.ndarray] | None): Optional masks to update the memory.
|
1783
1783
|
points (List[List[float]] | None): Optional list of points to update the memory, each point is [x, y].
|
@@ -1789,7 +1789,7 @@ class SAM2DynamicInteractivePredictor(SAM2Predictor):
|
|
1789
1789
|
res_masks (torch.Tensor): The output masks in shape (C, H, W)
|
1790
1790
|
object_score_logits (torch.Tensor): Quality scores for each mask
|
1791
1791
|
"""
|
1792
|
-
self.get_im_features(
|
1792
|
+
self.get_im_features(im)
|
1793
1793
|
points, labels, masks = self._prepare_prompts(
|
1794
1794
|
dst_shape=self.imgsz,
|
1795
1795
|
src_shape=self.batch[1][0].shape[:2],
|
ultralytics/nn/autobackend.py
CHANGED
@@ -724,17 +724,14 @@ class AutoBackend(nn.Module):
|
|
724
724
|
im_pil = Image.fromarray((im * 255).astype("uint8"))
|
725
725
|
# im = im.resize((192, 320), Image.BILINEAR)
|
726
726
|
y = self.model.predict({"image": im_pil}) # coordinates are xywh normalized
|
727
|
-
if "confidence" in y:
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
)
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
# conf, cls = y['confidence'].max(1), y['confidence'].argmax(1).astype(np.float32)
|
736
|
-
# y = np.concatenate((box, conf.reshape(-1, 1), cls.reshape(-1, 1)), 1)
|
737
|
-
y = list(y.values())
|
727
|
+
if "confidence" in y: # NMS included
|
728
|
+
from ultralytics.utils.ops import xywh2xyxy
|
729
|
+
|
730
|
+
box = xywh2xyxy(y["coordinates"] * [[w, h, w, h]]) # xyxy pixels
|
731
|
+
cls = y["confidence"].argmax(1, keepdims=True)
|
732
|
+
y = np.concatenate((box, np.take_along_axis(y["confidence"], cls, axis=1), cls), 1)[None]
|
733
|
+
else:
|
734
|
+
y = list(y.values())
|
738
735
|
if len(y) == 2 and len(y[1].shape) != 4: # segmentation model
|
739
736
|
y = list(reversed(y)) # reversed for segmentation models (pred, proto)
|
740
737
|
|
ultralytics/utils/__init__.py
CHANGED
@@ -460,8 +460,7 @@ def set_logging(name="LOGGING_NAME", verbose=True):
|
|
460
460
|
|
461
461
|
# Set logger
|
462
462
|
LOGGER = set_logging(LOGGING_NAME, verbose=VERBOSE) # define globally (used in train.py, val.py, predict.py, etc.)
|
463
|
-
|
464
|
-
logging.getLogger(logger).setLevel(logging.CRITICAL + 1)
|
463
|
+
logging.getLogger("sentry_sdk").setLevel(logging.CRITICAL + 1)
|
465
464
|
|
466
465
|
|
467
466
|
def emojis(string=""):
|
@@ -3,8 +3,9 @@
|
|
3
3
|
import json
|
4
4
|
from time import time
|
5
5
|
|
6
|
-
from ultralytics.hub import HUB_WEB_ROOT, PREFIX, HUBTrainingSession
|
6
|
+
from ultralytics.hub import HUB_WEB_ROOT, PREFIX, HUBTrainingSession
|
7
7
|
from ultralytics.utils import LOGGER, RANK, SETTINGS
|
8
|
+
from ultralytics.utils.events import events
|
8
9
|
|
9
10
|
|
10
11
|
def on_pretrain_routine_start(trainer):
|
@@ -0,0 +1,115 @@
|
|
1
|
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2
|
+
|
3
|
+
import json
|
4
|
+
import random
|
5
|
+
import time
|
6
|
+
from pathlib import Path
|
7
|
+
from threading import Thread
|
8
|
+
from urllib.request import Request, urlopen
|
9
|
+
|
10
|
+
from ultralytics import SETTINGS, __version__
|
11
|
+
from ultralytics.utils import ARGV, ENVIRONMENT, GIT, IS_PIP_PACKAGE, ONLINE, PYTHON_VERSION, RANK, TESTS_RUNNING
|
12
|
+
from ultralytics.utils.downloads import GITHUB_ASSETS_NAMES
|
13
|
+
from ultralytics.utils.torch_utils import get_cpu_info
|
14
|
+
|
15
|
+
|
16
|
+
def _post(url: str, data: dict, timeout: float = 5.0) -> None:
|
17
|
+
"""Send a one-shot JSON POST request."""
|
18
|
+
try:
|
19
|
+
body = json.dumps(data, separators=(",", ":")).encode() # compact JSON
|
20
|
+
req = Request(url, data=body, headers={"Content-Type": "application/json"})
|
21
|
+
urlopen(req, timeout=timeout).close()
|
22
|
+
except Exception:
|
23
|
+
pass
|
24
|
+
|
25
|
+
|
26
|
+
class Events:
|
27
|
+
"""
|
28
|
+
Collect and send anonymous usage analytics with rate-limiting.
|
29
|
+
|
30
|
+
Event collection and transmission are enabled when sync is enabled in settings, the current process is rank -1 or 0,
|
31
|
+
tests are not running, the environment is online, and the installation source is either pip or the official
|
32
|
+
Ultralytics GitHub repository.
|
33
|
+
|
34
|
+
Attributes:
|
35
|
+
url (str): Measurement Protocol endpoint for receiving anonymous events.
|
36
|
+
events (list[dict]): In-memory queue of event payloads awaiting transmission.
|
37
|
+
rate_limit (float): Minimum time in seconds between POST requests.
|
38
|
+
t (float): Timestamp of the last transmission in seconds since the epoch.
|
39
|
+
metadata (dict): Static metadata describing runtime, installation source, and environment.
|
40
|
+
enabled (bool): Flag indicating whether analytics collection is active.
|
41
|
+
|
42
|
+
Methods:
|
43
|
+
__init__: Initialize the event queue, rate limiter, and runtime metadata.
|
44
|
+
__call__: Queue an event and trigger a non-blocking send when the rate limit elapses.
|
45
|
+
"""
|
46
|
+
|
47
|
+
url = "https://www.google-analytics.com/mp/collect?measurement_id=G-X8NCJYTQXM&api_secret=QLQrATrNSwGRFRLE-cbHJw"
|
48
|
+
|
49
|
+
def __init__(self) -> None:
|
50
|
+
"""Initialize the Events instance with queue, rate limiter, and environment metadata."""
|
51
|
+
self.events = [] # pending events
|
52
|
+
self.rate_limit = 30.0 # rate limit (seconds)
|
53
|
+
self.t = 0.0 # last send timestamp (seconds)
|
54
|
+
self.metadata = {
|
55
|
+
"cli": Path(ARGV[0]).name == "yolo",
|
56
|
+
"install": "git" if GIT.is_repo else "pip" if IS_PIP_PACKAGE else "other",
|
57
|
+
"python": PYTHON_VERSION.rsplit(".", 1)[0], # i.e. 3.13
|
58
|
+
"CPU": get_cpu_info(),
|
59
|
+
# "GPU": get_gpu_info(index=0) if cuda else None,
|
60
|
+
"version": __version__,
|
61
|
+
"env": ENVIRONMENT,
|
62
|
+
"session_id": round(random.random() * 1e15),
|
63
|
+
"engagement_time_msec": 1000,
|
64
|
+
}
|
65
|
+
self.enabled = (
|
66
|
+
SETTINGS["sync"]
|
67
|
+
and RANK in {-1, 0}
|
68
|
+
and not TESTS_RUNNING
|
69
|
+
and ONLINE
|
70
|
+
and (IS_PIP_PACKAGE or GIT.origin == "https://github.com/ultralytics/ultralytics.git")
|
71
|
+
)
|
72
|
+
|
73
|
+
def __call__(self, cfg, device=None) -> None:
|
74
|
+
"""
|
75
|
+
Queue an event and flush the queue asynchronously when the rate limit elapses.
|
76
|
+
|
77
|
+
Args:
|
78
|
+
cfg (IterableSimpleNamespace): The configuration object containing mode and task information.
|
79
|
+
device (torch.device | str, optional): The device type (e.g., 'cpu', 'cuda').
|
80
|
+
"""
|
81
|
+
if not self.enabled:
|
82
|
+
# Events disabled, do nothing
|
83
|
+
return
|
84
|
+
|
85
|
+
# Attempt to enqueue a new event
|
86
|
+
if len(self.events) < 25: # Queue limited to 25 events to bound memory and traffic
|
87
|
+
params = {
|
88
|
+
**self.metadata,
|
89
|
+
"task": cfg.task,
|
90
|
+
"model": cfg.model if cfg.model in GITHUB_ASSETS_NAMES else "custom",
|
91
|
+
"device": str(device),
|
92
|
+
}
|
93
|
+
if cfg.mode == "export":
|
94
|
+
params["format"] = cfg.format
|
95
|
+
self.events.append({"name": cfg.mode, "params": params})
|
96
|
+
|
97
|
+
# Check rate limit and return early if under limit
|
98
|
+
t = time.time()
|
99
|
+
if (t - self.t) < self.rate_limit:
|
100
|
+
return
|
101
|
+
|
102
|
+
# Overrate limit: send a snapshot of queued events in a background thread
|
103
|
+
payload_events = list(self.events) # snapshot to avoid race with queue reset
|
104
|
+
Thread(
|
105
|
+
target=_post,
|
106
|
+
args=(self.url, {"client_id": SETTINGS["uuid"], "events": payload_events}), # SHA-256 anonymized
|
107
|
+
daemon=True,
|
108
|
+
).start()
|
109
|
+
|
110
|
+
# Reset queue and rate limit timer
|
111
|
+
self.events = []
|
112
|
+
self.t = t
|
113
|
+
|
114
|
+
|
115
|
+
events = Events()
|
ultralytics/utils/ops.py
CHANGED
@@ -244,7 +244,9 @@ def scale_image(masks, im0_shape, ratio_pad=None):
|
|
244
244
|
if len(masks.shape) < 2:
|
245
245
|
raise ValueError(f'"len of masks shape" should be 2 or 3, but got {len(masks.shape)}')
|
246
246
|
masks = masks[top:bottom, left:right]
|
247
|
-
|
247
|
+
# handle the cv2.resize 512 channels limitation: https://github.com/ultralytics/ultralytics/pull/21947
|
248
|
+
masks = [cv2.resize(array, (im0_w, im0_h)) for array in np.array_split(masks, masks.shape[-1] // 512 + 1, axis=-1)]
|
249
|
+
masks = np.concatenate(masks, axis=-1) if len(masks) > 1 else masks[0]
|
248
250
|
if len(masks.shape) == 2:
|
249
251
|
masks = masks[:, :, None]
|
250
252
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|