dgenerate-ultralytics-headless 8.3.144__py3-none-any.whl → 8.3.146__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.144.dist-info → dgenerate_ultralytics_headless-8.3.146.dist-info}/METADATA +2 -2
- {dgenerate_ultralytics_headless-8.3.144.dist-info → dgenerate_ultralytics_headless-8.3.146.dist-info}/RECORD +36 -35
- {dgenerate_ultralytics_headless-8.3.144.dist-info → dgenerate_ultralytics_headless-8.3.146.dist-info}/WHEEL +1 -1
- tests/__init__.py +3 -0
- tests/test_cli.py +2 -7
- tests/test_python.py +42 -12
- ultralytics/__init__.py +1 -1
- ultralytics/cfg/__init__.py +0 -1
- ultralytics/cfg/datasets/coco8-grayscale.yaml +103 -0
- ultralytics/data/augment.py +2 -2
- ultralytics/engine/model.py +14 -13
- ultralytics/engine/results.py +4 -4
- ultralytics/engine/validator.py +1 -1
- ultralytics/models/nas/model.py +0 -8
- ultralytics/models/yolo/classify/val.py +1 -5
- ultralytics/models/yolo/detect/val.py +9 -16
- ultralytics/models/yolo/obb/val.py +24 -17
- ultralytics/models/yolo/pose/val.py +19 -14
- ultralytics/models/yolo/segment/val.py +52 -44
- ultralytics/solutions/ai_gym.py +3 -5
- ultralytics/solutions/analytics.py +17 -9
- ultralytics/solutions/heatmap.py +1 -1
- ultralytics/solutions/instance_segmentation.py +1 -1
- ultralytics/solutions/object_counter.py +2 -8
- ultralytics/solutions/solutions.py +5 -4
- ultralytics/trackers/bot_sort.py +4 -2
- ultralytics/utils/__init__.py +1 -2
- ultralytics/utils/benchmarks.py +18 -16
- ultralytics/utils/checks.py +10 -5
- ultralytics/utils/downloads.py +1 -0
- ultralytics/utils/metrics.py +25 -26
- ultralytics/utils/plotting.py +10 -7
- ultralytics/utils/torch_utils.py +2 -2
- {dgenerate_ultralytics_headless-8.3.144.dist-info → dgenerate_ultralytics_headless-8.3.146.dist-info}/entry_points.txt +0 -0
- {dgenerate_ultralytics_headless-8.3.144.dist-info → dgenerate_ultralytics_headless-8.3.146.dist-info}/licenses/LICENSE +0 -0
- {dgenerate_ultralytics_headless-8.3.144.dist-info → dgenerate_ultralytics_headless-8.3.146.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.146
|
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>
|
@@ -55,7 +55,7 @@ Requires-Dist: coverage[toml]; extra == "dev"
|
|
55
55
|
Requires-Dist: mkdocs>=1.6.0; extra == "dev"
|
56
56
|
Requires-Dist: mkdocs-material>=9.5.9; extra == "dev"
|
57
57
|
Requires-Dist: mkdocstrings[python]; extra == "dev"
|
58
|
-
Requires-Dist: mkdocs-ultralytics-plugin>=0.1.
|
58
|
+
Requires-Dist: mkdocs-ultralytics-plugin>=0.1.19; extra == "dev"
|
59
59
|
Requires-Dist: mkdocs-macros-plugin>=1.0.5; extra == "dev"
|
60
60
|
Provides-Extra: export
|
61
61
|
Requires-Dist: onnx<1.18.0,>=1.12.0; extra == "export"
|
@@ -1,17 +1,17 @@
|
|
1
|
-
dgenerate_ultralytics_headless-8.3.
|
2
|
-
tests/__init__.py,sha256=
|
1
|
+
dgenerate_ultralytics_headless-8.3.146.dist-info/licenses/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
2
|
+
tests/__init__.py,sha256=b4KP5_q-2IO8Br8YHOSLYnn7IwZS81l_vfEF2YPa2lM,894
|
3
3
|
tests/conftest.py,sha256=JjgKSs36ZaGmmtqGmAapmFSoFF1YwyV3IZsOgqt2IVM,2593
|
4
|
-
tests/test_cli.py,sha256=
|
4
|
+
tests/test_cli.py,sha256=Kpfxq_RlbKK1Z8xNScDUbre6GB7neZhXZAYGI1tiDS8,5660
|
5
5
|
tests/test_cuda.py,sha256=-nQsfF3lGfqLm6cIeu_BCiXqLj7HzpL7R1GzPEc6z2I,8128
|
6
6
|
tests/test_engine.py,sha256=Jpt2KVrltrEgh2-3Ykouz-2Z_2fza0eymL5ectRXadM,4922
|
7
7
|
tests/test_exports.py,sha256=HmMKOTCia9ZDC0VYc_EPmvBTM5LM5eeI1NF_pKjLpd8,9677
|
8
8
|
tests/test_integrations.py,sha256=cQfgueFhEZ8Xs-tF0uiIEhvn0DlhOH-Wqrx96LXp3D0,6303
|
9
|
-
tests/test_python.py,sha256=
|
9
|
+
tests/test_python.py,sha256=x5m2RAVWnzu5uT5sYnx8ybHpHycToWjzfJJZUklVxqQ,27386
|
10
10
|
tests/test_solutions.py,sha256=tuf6n_fsI8KvSdJrnc-cqP2qYdiYqCWuVrx0z9dOz3Q,13213
|
11
|
-
ultralytics/__init__.py,sha256=
|
11
|
+
ultralytics/__init__.py,sha256=rr8AlK0l4sHv7KJzILIXcGq-I8vDhSKXc5B_8Lf_yO8,730
|
12
12
|
ultralytics/assets/bus.jpg,sha256=wCAZxJecGR63Od3ZRERe9Aja1Weayrb9Ug751DS_vGM,137419
|
13
13
|
ultralytics/assets/zidane.jpg,sha256=Ftc4aeMmen1O0A3o6GCDO9FlfBslLpTAw0gnetx7bts,50427
|
14
|
-
ultralytics/cfg/__init__.py,sha256=
|
14
|
+
ultralytics/cfg/__init__.py,sha256=H19EalaxuIa44J_nVBrNxMj8EAPmlZl3ecbX0-xK8y8,39600
|
15
15
|
ultralytics/cfg/default.yaml,sha256=oFG6llJO-Py5H-cR9qs-7FieJamroDLwpbrkhmfROOM,8307
|
16
16
|
ultralytics/cfg/datasets/Argoverse.yaml,sha256=_xlEDIJ9XkUo0v_iNL7FW079BoSeZtKSuLteKTtGbA8,3275
|
17
17
|
ultralytics/cfg/datasets/DOTAv1.5.yaml,sha256=SHND_CFkojxw5iQD5Mcgju2kCZIl0gW2ajuzv1cqoL0,1224
|
@@ -30,6 +30,7 @@ ultralytics/cfg/datasets/coco-pose.yaml,sha256=NHdgSsGkHS0-X636p2-hExTJGdoWUSP1T
|
|
30
30
|
ultralytics/cfg/datasets/coco.yaml,sha256=chdzyIHLfekjOcng-G2_bpC57VUcHPjVvW8ENJfiQao,2619
|
31
31
|
ultralytics/cfg/datasets/coco128-seg.yaml,sha256=ifDPbVuuN7N2_3e8e_YBdTVcANYIOKORQMgXlsPS6D4,1995
|
32
32
|
ultralytics/cfg/datasets/coco128.yaml,sha256=udymG6qzF9Bvh_JYC7BOSXOUeA1Ia8ZmR2EzNGsY6YY,1978
|
33
|
+
ultralytics/cfg/datasets/coco8-grayscale.yaml,sha256=U3jjPUoFahLch4N11qjG1myhE5wsy2tFeC23I9w_nr0,1974
|
33
34
|
ultralytics/cfg/datasets/coco8-multispectral.yaml,sha256=h5Kbx9y3wjWUw6p8jeQVUaIs07VoQS7ZY0vMau5WGAg,2076
|
34
35
|
ultralytics/cfg/datasets/coco8-pose.yaml,sha256=yfw2_SkCZO3ttPLiI0mfjxv5gr4-CA3i0elYP5PY71k,1022
|
35
36
|
ultralytics/cfg/datasets/coco8-seg.yaml,sha256=wpfFI-GfL5asbLtFyaHLE6593jdka7waE07Am3_eg8w,1926
|
@@ -105,7 +106,7 @@ ultralytics/cfg/trackers/botsort.yaml,sha256=TpRaK5kH_-QbjCQ7ekM4s_7j8I8ti3q8Hs7
|
|
105
106
|
ultralytics/cfg/trackers/bytetrack.yaml,sha256=6u-tiZlk16EqEwkNXaMrza6PAQmWj_ypgv26LGCtPDg,886
|
106
107
|
ultralytics/data/__init__.py,sha256=nAXaL1puCc7z_NjzQNlJnhbVhT9Fla2u7Dsqo7q1dAc,644
|
107
108
|
ultralytics/data/annotator.py,sha256=uAgd7K-yudxiwdNqHz0ubfFg5JsfNlae4cgxdvCMyuY,3030
|
108
|
-
ultralytics/data/augment.py,sha256=
|
109
|
+
ultralytics/data/augment.py,sha256=fvYug6B0qrSSS8IYpvdju9uENnEJWCf-GNG5WqIayng,128964
|
109
110
|
ultralytics/data/base.py,sha256=mRcuehK1thNuuzQGL6D1AaZkod71oHRdYTod_zdQZQg,19688
|
110
111
|
ultralytics/data/build.py,sha256=Djz6stD1FXmFhnoUJp-MKp7geu-k3xhnvt9kfXFKGhI,11020
|
111
112
|
ultralytics/data/converter.py,sha256=oKW8ODtvFOKBx9Un8n87xUUm3b5GStU4ViIBH5UDylM,27200
|
@@ -120,12 +121,12 @@ ultralytics/data/scripts/get_coco128.sh,sha256=qmRQl_hOKrsdHrTrnyQuFIH01oDz3lfaz
|
|
120
121
|
ultralytics/data/scripts/get_imagenet.sh,sha256=hr42H16bM47iT27rgS7MpEo-GeOZAYUQXgr0B2cwn48,1705
|
121
122
|
ultralytics/engine/__init__.py,sha256=lm6MckFYCPTbqIoX7w0s_daxdjNeBeKW6DXppv1-QUM,70
|
122
123
|
ultralytics/engine/exporter.py,sha256=Ug0HvQSseQA9k4jb_CUGXKPg9w082W1cocwPxxtXgkM,73902
|
123
|
-
ultralytics/engine/model.py,sha256=
|
124
|
+
ultralytics/engine/model.py,sha256=nOhlQFUTXrghmAfHLo97rji8HCt2vzIhGO6TruWvrNI,53315
|
124
125
|
ultralytics/engine/predictor.py,sha256=30fBpuwOuNT3hr8bju4coeOr-jqU_8hDYESugmowLBE,22151
|
125
|
-
ultralytics/engine/results.py,sha256=
|
126
|
+
ultralytics/engine/results.py,sha256=Mb8pBTOrBtQh0PQtGVbhRZ_C1VyqYFumjLggiKCRIJs,72295
|
126
127
|
ultralytics/engine/trainer.py,sha256=zZ2Lm7VJOlBX-Ya52ec3n3IlSn9_yM5fbsRIWGeGOyo,39556
|
127
128
|
ultralytics/engine/tuner.py,sha256=4ue7JbMFQp7JcWhhwCAY-b-xZsjm5VKVlPFDUTyxt_8,12789
|
128
|
-
ultralytics/engine/validator.py,sha256=
|
129
|
+
ultralytics/engine/validator.py,sha256=2YEdIn2DpPdUPjwDJDR0d0DU8BiwFmh2_502xDPGwMo,16953
|
129
130
|
ultralytics/hub/__init__.py,sha256=ulPtceI3hqud03mvqoXccBaa1e4nveYwC9cddyuBUlo,6599
|
130
131
|
ultralytics/hub/auth.py,sha256=5uMPzZt8aO-YsnEWADzc1qBUt9c30RTIfrGo5SWTrv4,6271
|
131
132
|
ultralytics/hub/session.py,sha256=UeUSRbdclSBPJQfpSNGeY13gb1O2Bhzh0Aj7cXum6P4,18518
|
@@ -138,7 +139,7 @@ ultralytics/models/fastsam/predict.py,sha256=G-o8hs8W5XmqSN5G37zi6q9FglFnZSbD6qH
|
|
138
139
|
ultralytics/models/fastsam/utils.py,sha256=yuCXB4CVjRx8lDf61DP8B6qMx7TVf7AynQvdWREeFco,884
|
139
140
|
ultralytics/models/fastsam/val.py,sha256=hDGCcQl04GA8ldDlRHUN3fri_N2Aev3Vu7-r3BftmvE,2335
|
140
141
|
ultralytics/models/nas/__init__.py,sha256=wybeHZuAXMNeXMjKTbK55FZmXJkA4K9IozDeFM9OB-s,207
|
141
|
-
ultralytics/models/nas/model.py,sha256=
|
142
|
+
ultralytics/models/nas/model.py,sha256=kQeF3mkVHLLsoTL9F32CrYITNsdbTrYF6lEgHclhKN0,3824
|
142
143
|
ultralytics/models/nas/predict.py,sha256=J4UT7nwi_h63lJ3a_gYac-Ws8wFYingZINxMqSoaX5E,2706
|
143
144
|
ultralytics/models/nas/val.py,sha256=QUTE3zuhJLVqmDGd2n7iSSk7X6jKZCRxufFkBbyxYYo,1548
|
144
145
|
ultralytics/models/rtdetr/__init__.py,sha256=_jEHmOjI_QP_nT3XJXLgYHQ6bXG4EL8Gnvn1y_eev1g,225
|
@@ -168,23 +169,23 @@ ultralytics/models/yolo/model.py,sha256=C0wInQC6rFuFOGpdAen1s2e5LIFDmqevto8uPbpm
|
|
168
169
|
ultralytics/models/yolo/classify/__init__.py,sha256=9--HVaNOfI1K7rn_rRqclL8FUAnpfeBrRqEQIaQw2xM,383
|
169
170
|
ultralytics/models/yolo/classify/predict.py,sha256=_GiN6muuZOBrMS1KER85FE4ktcw_Onn1bZdGvpbsGCE,4618
|
170
171
|
ultralytics/models/yolo/classify/train.py,sha256=jXErkxnsC3pBFQBrFxObF8BJyqkckcw3C_qHMSWZrsY,10312
|
171
|
-
ultralytics/models/yolo/classify/val.py,sha256=
|
172
|
+
ultralytics/models/yolo/classify/val.py,sha256=G2huxA1Lf2BL4OUK0Gw43klhG3eLOFMFfhnFjmziKhQ,9721
|
172
173
|
ultralytics/models/yolo/detect/__init__.py,sha256=GIRsLYR-kT4JJx7lh4ZZAFGBZj0aebokuU0A7JbjDVA,257
|
173
174
|
ultralytics/models/yolo/detect/predict.py,sha256=ySUsdIf8dw00bzWhcxN1jZwLWKPRT2M7-N7TNL3o4zo,5387
|
174
175
|
ultralytics/models/yolo/detect/train.py,sha256=qCWz0nvU-pQofa-_F7UhUoLQe-U1ExW0mvE5ZHnav4o,9818
|
175
|
-
ultralytics/models/yolo/detect/val.py,sha256=
|
176
|
+
ultralytics/models/yolo/detect/val.py,sha256=MCXImLgaoTPDoQvQW9KZyUrtHxVW5xAY3-bxdenZe-c,19164
|
176
177
|
ultralytics/models/yolo/obb/__init__.py,sha256=tQmpG8wVHsajWkZdmD6cjGohJ4ki64iSXQT8JY_dydo,221
|
177
178
|
ultralytics/models/yolo/obb/predict.py,sha256=4r1eSld6TNJlk9JG56e-DX6oPL8uBBqiuztyBpxWlHE,2888
|
178
179
|
ultralytics/models/yolo/obb/train.py,sha256=bnYFAMur7Uvbw5Dc09-S2ge7B05iGX-t37Ksgc0ef6g,3921
|
179
|
-
ultralytics/models/yolo/obb/val.py,sha256=
|
180
|
+
ultralytics/models/yolo/obb/val.py,sha256=pizYmRUkSlglQnNjZi0DeZehCJE9y5CmYjs_tGLDta4,14394
|
180
181
|
ultralytics/models/yolo/pose/__init__.py,sha256=63xmuHZLNzV8I76HhVXAq4f2W0KTk8Oi9eL-Y204LyQ,227
|
181
182
|
ultralytics/models/yolo/pose/predict.py,sha256=oePbV_IVRt0xPcTiycFAIixiX7bScth0d1uOOtdeErU,3773
|
182
183
|
ultralytics/models/yolo/pose/train.py,sha256=6i1EQx-f112skBBBhCk6JIRKLjCoTEqw2ECJrc53Ku8,6862
|
183
|
-
ultralytics/models/yolo/pose/val.py,sha256=
|
184
|
+
ultralytics/models/yolo/pose/val.py,sha256=2QPhqVr90Aww2RKxuK36kGh_m3vbvWdMDhBDCb8Ho6M,19598
|
184
185
|
ultralytics/models/yolo/segment/__init__.py,sha256=3IThhZ1wlkY9FvmWm9cE-5-ZyE6F1FgzAtQ6jOOFzzw,275
|
185
186
|
ultralytics/models/yolo/segment/predict.py,sha256=qlprQCZn4_bpjpI08U0MU9Q9_1gpHrw_7MXwtXE1l1Y,5377
|
186
187
|
ultralytics/models/yolo/segment/train.py,sha256=026mRDOIjJ0ctMQQ2N9hRP6E5oLj2meGKO46u_MzrDk,5523
|
187
|
-
ultralytics/models/yolo/segment/val.py,sha256=
|
188
|
+
ultralytics/models/yolo/segment/val.py,sha256=KMB63KwqWF06mEwBgB7PqNdDy0qSzc0tYKPEvC1ykCg,19020
|
188
189
|
ultralytics/models/yolo/world/__init__.py,sha256=nlh8I6t8hMGz_vZg8QSlsUW1R-2eKvn9CGUoPPQEGhA,131
|
189
190
|
ultralytics/models/yolo/world/train.py,sha256=94_hgCluzsv39JkBVDmR2gjuycYjeJC8wVrCfrjpENk,7806
|
190
191
|
ultralytics/models/yolo/world/train_world.py,sha256=YJm37ZTgr0CoE_sYrjxN45w9mICr2RMWfWZrriiHqbM,9022
|
@@ -205,21 +206,21 @@ ultralytics/nn/modules/head.py,sha256=zTXFXc46ljPdP3mjgH7B3y2bPIjvbVPtgTu_rQCV8x
|
|
205
206
|
ultralytics/nn/modules/transformer.py,sha256=PW5-6gzOP3_rZ_uAkmxvI42nU5bkrgbgLKCy5PC5px4,31415
|
206
207
|
ultralytics/nn/modules/utils.py,sha256=rn8yTObZGkQoqVzjbZWLaHiytppG4ffjMME4Lw60glM,6092
|
207
208
|
ultralytics/solutions/__init__.py,sha256=ZoeAQavTLp8aClnhZ9tbl6lxy86GxofyGvZWTx2aWkI,1209
|
208
|
-
ultralytics/solutions/ai_gym.py,sha256=
|
209
|
-
ultralytics/solutions/analytics.py,sha256=
|
209
|
+
ultralytics/solutions/ai_gym.py,sha256=A8vzdjTqOF2mFAiiy7zu3f8lzwqLJ07dk5aqZ8p-x_w,5256
|
210
|
+
ultralytics/solutions/analytics.py,sha256=IfYlXV4vufpaOZz9h8cT1Vx9RjsqQYTCB7SbDlR0zv0,12784
|
210
211
|
ultralytics/solutions/config.py,sha256=1HZvgWPt7duDxqAaOTyu4-TOBeRJeWx5EQgUwnyyO50,5394
|
211
212
|
ultralytics/solutions/distance_calculation.py,sha256=e2Xa7dVOqiuk43JNakoxQlX48evEgZiEtxdtHTdlAsk,5931
|
212
|
-
ultralytics/solutions/heatmap.py,sha256=
|
213
|
-
ultralytics/solutions/instance_segmentation.py,sha256=
|
213
|
+
ultralytics/solutions/heatmap.py,sha256=IVnTOyIbxKrhmnzGbkncIqPakPHeJe4nrwQkOPJ00wY,5421
|
214
|
+
ultralytics/solutions/instance_segmentation.py,sha256=HBWkCwmRa0jk84q4fhANzGpyirAtiCkAKRt0j9ED_Cw,3739
|
214
215
|
ultralytics/solutions/object_blurrer.py,sha256=UVd9EGpyb_fJXFnPg3lbnhWxY1ntHVWmIJ2ragbZ6eY,3942
|
215
|
-
ultralytics/solutions/object_counter.py,sha256=
|
216
|
+
ultralytics/solutions/object_counter.py,sha256=1iPJW_59iIw8DZedYdjw7HIQINpQtEBCd190g6TosNA,9353
|
216
217
|
ultralytics/solutions/object_cropper.py,sha256=SVB9fflB7-juZWUARpi-kndSZDVI-oXjHg4WUnOuA9A,3470
|
217
218
|
ultralytics/solutions/parking_management.py,sha256=IHWK48DZa6PwaOKUu3XTJAZCxF6WtTlCno7N8W6VR4k,13481
|
218
219
|
ultralytics/solutions/queue_management.py,sha256=_K6ugLMDfpp37S-LFV36K3QXf3vqjfxji8BPP_-6iqc,4337
|
219
220
|
ultralytics/solutions/region_counter.py,sha256=8vNrr0SnEBJ7ngD_whWpD7jMlrzuYGWxUuZx3WOv0ys,5739
|
220
221
|
ultralytics/solutions/security_alarm.py,sha256=HXoPFlTOVp5eUecPuGIl_DXLKuN8-M32BCvCOd_vRac,6279
|
221
222
|
ultralytics/solutions/similarity_search.py,sha256=GdrPEpfBwLpM5Mx4XQiTrahgdQgiSIeGdHWWTLQl5xU,9926
|
222
|
-
ultralytics/solutions/solutions.py,sha256=
|
223
|
+
ultralytics/solutions/solutions.py,sha256=3JGuGGzEvgKHw_XYNv11yo_PxZlSqduIuW8fyrNeZ4E,37407
|
223
224
|
ultralytics/solutions/speed_estimation.py,sha256=_4tIfWPI7O_hYRQAvNrALMzdy2sBR5_0BxnPdJb0Gks,5823
|
224
225
|
ultralytics/solutions/streamlit_inference.py,sha256=menjJLsuP7AsQJSnBo7gRHfMlYE8HzMp0YNGqCU64n0,9986
|
225
226
|
ultralytics/solutions/trackzone.py,sha256=LRCG5HhcZb9PiYWbkUPeWuIOnNskPE4FEDY6a3Y4ctA,3850
|
@@ -227,31 +228,31 @@ ultralytics/solutions/vision_eye.py,sha256=LCb-2YPVvEks9e7xqZtNGftpAXNaZhEUb5yb3
|
|
227
228
|
ultralytics/solutions/templates/similarity-search.html,sha256=DPoAO-1H-KXNt_T8mGtSCsYUEi_5Nrx01p0cZfX-E8Q,3790
|
228
229
|
ultralytics/trackers/__init__.py,sha256=Zlu_Ig5osn7hqch_g5Be_e4pwZUkeeTQiesJCi0pFGI,255
|
229
230
|
ultralytics/trackers/basetrack.py,sha256=-skBFFatzgJFAPN9Frm1u1h_RDUg3WOlxG6eHQxp2Gw,4384
|
230
|
-
ultralytics/trackers/bot_sort.py,sha256=
|
231
|
+
ultralytics/trackers/bot_sort.py,sha256=knP5oo1LC45Lrato8LpcY_j4KBojQFP1lxT_NJxhEUo,12134
|
231
232
|
ultralytics/trackers/byte_tracker.py,sha256=CNS10VOGPtXXEimi0TaO88TAIcOBgo8ALF9H79iK_uQ,21633
|
232
233
|
ultralytics/trackers/track.py,sha256=EmYi42ujLP3_CKuS6CmO_9dw8Ekg7-0WWJQeYfQucv0,4804
|
233
234
|
ultralytics/trackers/utils/__init__.py,sha256=lm6MckFYCPTbqIoX7w0s_daxdjNeBeKW6DXppv1-QUM,70
|
234
235
|
ultralytics/trackers/utils/gmc.py,sha256=9IvCf5MhBYY9ppVHykN02_oBWHmE98R8EaYFKaykdV0,14032
|
235
236
|
ultralytics/trackers/utils/kalman_filter.py,sha256=PPmM0lwBMdT_hGojvfLoUsBUFMBBMNRAxKbMcQa3wJ0,21619
|
236
237
|
ultralytics/trackers/utils/matching.py,sha256=uSYtywqi1lE_uNN1FwuBFPyISfDQXHMu8K5KH69nrRI,7160
|
237
|
-
ultralytics/utils/__init__.py,sha256=
|
238
|
+
ultralytics/utils/__init__.py,sha256=CahopjtuOs7q9uKm5NX89vm8iGE8_DJlwvmvX71ezQE,59523
|
238
239
|
ultralytics/utils/autobatch.py,sha256=33m8YgggLIhltDqMXZ5OE-FGs2QiHrl2-LfgY1mI4cw,5119
|
239
240
|
ultralytics/utils/autodevice.py,sha256=AvgXFt8c1Cg4icKh0Hbhhz8UmVQ2Wjyfdfkeb2C8zck,8855
|
240
|
-
ultralytics/utils/benchmarks.py,sha256=
|
241
|
-
ultralytics/utils/checks.py,sha256=
|
241
|
+
ultralytics/utils/benchmarks.py,sha256=14jidnH74g_ZCChuJF5qUnQ2YugX5amGTjea9__RlJ4,30836
|
242
|
+
ultralytics/utils/checks.py,sha256=PPVmxfxoHuC4YR7i56uklCKXFAPnltzbHHCxUwERjUQ,34100
|
242
243
|
ultralytics/utils/dist.py,sha256=A9lDGtGefTjSVvVS38w86GOdbtLzNBDZuDGK0MT4PRI,4170
|
243
|
-
ultralytics/utils/downloads.py,sha256=
|
244
|
+
ultralytics/utils/downloads.py,sha256=YB6rJkcRGQfklUjZqi9dOkTiZaDSqbkGyZEFcZLQkgc,22080
|
244
245
|
ultralytics/utils/errors.py,sha256=XT9Ru7ivoBgofK6PlnyigGoa7Fmf5nEhyHtnD-8TRXI,1584
|
245
246
|
ultralytics/utils/export.py,sha256=ZmxiY5Y2MuL4iBFsLr8ykbUsnvT01DCs0Kg1w3_Ikac,9789
|
246
247
|
ultralytics/utils/files.py,sha256=ZCbLGleiF0f-PqYfaxMFAWop88w7U1hpreHXl8b2ko0,8238
|
247
248
|
ultralytics/utils/instance.py,sha256=vhqaZRGT_4K9Q3oQH5KNNK4ISOzxlf1_JjauwhuFhu0,18408
|
248
249
|
ultralytics/utils/loss.py,sha256=fbOWc3Iu0QOJiWbi-mXWA9-1otTYlehtmUsI7os7ydM,39799
|
249
|
-
ultralytics/utils/metrics.py,sha256=
|
250
|
+
ultralytics/utils/metrics.py,sha256=mD5W7yr8T8XNHE0pJx38Ivcbq0PJIFGl0pq_sUOauuo,62122
|
250
251
|
ultralytics/utils/ops.py,sha256=Yjm397sirPt9wNlgHU2SeVEApeEeYX1msSg5cTBGN8g,34381
|
251
252
|
ultralytics/utils/patches.py,sha256=GI7NXCJ5H22FGp3sIvj5rrGfwdYNRWlxFcW-Jhjgius,5181
|
252
|
-
ultralytics/utils/plotting.py,sha256=
|
253
|
+
ultralytics/utils/plotting.py,sha256=QMwedj19XNHus5NbUY3cQI1PGDgriPhHOzGirBsxdK8,48277
|
253
254
|
ultralytics/utils/tal.py,sha256=aXawOnhn8ni65tJWIW-PYqWr_TRvltbHBjrTo7o6lDQ,20924
|
254
|
-
ultralytics/utils/torch_utils.py,sha256=
|
255
|
+
ultralytics/utils/torch_utils.py,sha256=iIAjf2g4hikzBeHvKN-EQK8QFlC_QtWWRuYQuBF2zIk,39184
|
255
256
|
ultralytics/utils/triton.py,sha256=M7qe4RztiADBJQEWQKaIQsp94ERFJ_8_DUHDR6TXEOM,5410
|
256
257
|
ultralytics/utils/tuner.py,sha256=bHr09Fz-0-t0ei55gX5wJh-obyiAQoicP7HUVM2I8qA,6826
|
257
258
|
ultralytics/utils/callbacks/__init__.py,sha256=hzL63Rce6VkZhP4Lcim9LKjadixaQG86nKqPhk7IkS0,242
|
@@ -265,8 +266,8 @@ ultralytics/utils/callbacks/neptune.py,sha256=j8pecmlcsM8FGzLKWoBw5xUsi5t8E5HuxY
|
|
265
266
|
ultralytics/utils/callbacks/raytune.py,sha256=S6Bq16oQDQ8BQgnZzA0zJHGN_BBr8iAM_WtGoLiEcwg,1283
|
266
267
|
ultralytics/utils/callbacks/tensorboard.py,sha256=MDPBW7aDes-66OE6YqKXXvqA_EocjzEMHWGM-8z9vUQ,5281
|
267
268
|
ultralytics/utils/callbacks/wb.py,sha256=Tm_-aRr2CN32MJkY9tylpMBJkb007-MSRNSQ7rDJ5QU,7521
|
268
|
-
dgenerate_ultralytics_headless-8.3.
|
269
|
-
dgenerate_ultralytics_headless-8.3.
|
270
|
-
dgenerate_ultralytics_headless-8.3.
|
271
|
-
dgenerate_ultralytics_headless-8.3.
|
272
|
-
dgenerate_ultralytics_headless-8.3.
|
269
|
+
dgenerate_ultralytics_headless-8.3.146.dist-info/METADATA,sha256=S-XDKqULYjwInhWCO3Hsz0CQNjN05mSB9T01h_3GVBs,38296
|
270
|
+
dgenerate_ultralytics_headless-8.3.146.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
271
|
+
dgenerate_ultralytics_headless-8.3.146.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
|
272
|
+
dgenerate_ultralytics_headless-8.3.146.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
|
273
|
+
dgenerate_ultralytics_headless-8.3.146.dist-info/RECORD,,
|
tests/__init__.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2
2
|
|
3
|
+
from ultralytics.cfg import TASK2DATA, TASK2MODEL, TASKS
|
3
4
|
from ultralytics.utils import ASSETS, ROOT, WEIGHTS_DIR, checks
|
4
5
|
|
5
6
|
# Constants used in tests
|
@@ -10,6 +11,8 @@ SOURCES_LIST = [ASSETS / "bus.jpg", ASSETS, ASSETS / "*", ASSETS / "**/*.jpg"]
|
|
10
11
|
TMP = (ROOT / "../tests/tmp").resolve() # temp directory for test files
|
11
12
|
CUDA_IS_AVAILABLE = checks.cuda_is_available()
|
12
13
|
CUDA_DEVICE_COUNT = checks.cuda_device_count()
|
14
|
+
TASK_MODEL_DATA = [(task, WEIGHTS_DIR / TASK2MODEL[task], TASK2DATA[task]) for task in TASKS]
|
15
|
+
MODELS = frozenset(list(TASK2MODEL.values()) + ["yolo11n-grayscale.pt"])
|
13
16
|
|
14
17
|
__all__ = (
|
15
18
|
"MODEL",
|
tests/test_cli.py
CHANGED
@@ -5,15 +5,10 @@ import subprocess
|
|
5
5
|
import pytest
|
6
6
|
from PIL import Image
|
7
7
|
|
8
|
-
from tests import CUDA_DEVICE_COUNT, CUDA_IS_AVAILABLE
|
9
|
-
from ultralytics.cfg import TASK2DATA, TASK2MODEL, TASKS
|
8
|
+
from tests import CUDA_DEVICE_COUNT, CUDA_IS_AVAILABLE, MODELS, TASK_MODEL_DATA
|
10
9
|
from ultralytics.utils import ARM64, ASSETS, LINUX, WEIGHTS_DIR, checks
|
11
10
|
from ultralytics.utils.torch_utils import TORCH_1_9
|
12
11
|
|
13
|
-
# Constants
|
14
|
-
TASK_MODEL_DATA = [(task, WEIGHTS_DIR / TASK2MODEL[task], TASK2DATA[task]) for task in TASKS]
|
15
|
-
MODELS = [WEIGHTS_DIR / TASK2MODEL[task] for task in TASKS]
|
16
|
-
|
17
12
|
|
18
13
|
def run(cmd: str) -> None:
|
19
14
|
"""Execute a shell command using subprocess."""
|
@@ -44,7 +39,7 @@ def test_val(task: str, model: str, data: str) -> None:
|
|
44
39
|
@pytest.mark.parametrize("task,model,data", TASK_MODEL_DATA)
|
45
40
|
def test_predict(task: str, model: str, data: str) -> None:
|
46
41
|
"""Test YOLO prediction on provided sample assets for specified task and model."""
|
47
|
-
run(f"yolo predict model={model} source={ASSETS} imgsz=32 save save_crop save_txt")
|
42
|
+
run(f"yolo {task} predict model={model} source={ASSETS} imgsz=32 save save_crop save_txt")
|
48
43
|
|
49
44
|
|
50
45
|
@pytest.mark.parametrize("model", MODELS)
|
tests/test_python.py
CHANGED
@@ -12,9 +12,9 @@ import pytest
|
|
12
12
|
import torch
|
13
13
|
from PIL import Image
|
14
14
|
|
15
|
-
from tests import CFG, MODEL, SOURCE, SOURCES_LIST, TMP
|
15
|
+
from tests import CFG, MODEL, MODELS, SOURCE, SOURCES_LIST, TASK_MODEL_DATA, TMP
|
16
16
|
from ultralytics import RTDETR, YOLO
|
17
|
-
from ultralytics.cfg import
|
17
|
+
from ultralytics.cfg import TASK2DATA, TASKS
|
18
18
|
from ultralytics.data.build import load_inference_source
|
19
19
|
from ultralytics.utils import (
|
20
20
|
ARM64,
|
@@ -112,21 +112,22 @@ def test_predict_csv_single_row():
|
|
112
112
|
@pytest.mark.parametrize("model_name", MODELS)
|
113
113
|
def test_predict_img(model_name):
|
114
114
|
"""Test YOLO model predictions on various image input types and sources, including online images."""
|
115
|
+
channels = 1 if model_name == "yolo11n-grayscale.pt" else 3
|
115
116
|
model = YOLO(WEIGHTS_DIR / model_name)
|
116
|
-
im = cv2.imread(str(SOURCE)) # uint8 numpy array
|
117
|
+
im = cv2.imread(str(SOURCE), flags=cv2.IMREAD_GRAYSCALE if channels == 1 else cv2.IMREAD_COLOR) # uint8 numpy array
|
117
118
|
assert len(model(source=Image.open(SOURCE), save=True, verbose=True, imgsz=32)) == 1 # PIL
|
118
119
|
assert len(model(source=im, save=True, save_txt=True, imgsz=32)) == 1 # ndarray
|
119
|
-
assert len(model(torch.rand((2,
|
120
|
+
assert len(model(torch.rand((2, channels, 32, 32)), imgsz=32)) == 2 # batch-size 2 Tensor, FP32 0.0-1.0 RGB order
|
120
121
|
assert len(model(source=[im, im], save=True, save_txt=True, imgsz=32)) == 2 # batch
|
121
122
|
assert len(list(model(source=[im, im], save=True, stream=True, imgsz=32))) == 2 # stream
|
122
|
-
assert len(model(torch.zeros(320, 640,
|
123
|
+
assert len(model(torch.zeros(320, 640, channels).numpy().astype(np.uint8), imgsz=32)) == 1 # tensor to numpy
|
123
124
|
batch = [
|
124
125
|
str(SOURCE), # filename
|
125
126
|
Path(SOURCE), # Path
|
126
127
|
"https://github.com/ultralytics/assets/releases/download/v0.0.0/zidane.jpg" if ONLINE else SOURCE, # URI
|
127
|
-
|
128
|
+
im, # OpenCV
|
128
129
|
Image.open(SOURCE), # PIL
|
129
|
-
np.zeros((320, 640,
|
130
|
+
np.zeros((320, 640, channels), dtype=np.uint8), # numpy
|
130
131
|
]
|
131
132
|
assert len(model(batch, imgsz=32, classes=0)) == len(batch) # multiple sources in a batch
|
132
133
|
|
@@ -177,14 +178,17 @@ def test_youtube():
|
|
177
178
|
|
178
179
|
@pytest.mark.skipif(not ONLINE, reason="environment is offline")
|
179
180
|
@pytest.mark.skipif(not IS_TMP_WRITEABLE, reason="directory is not writeable")
|
180
|
-
|
181
|
+
@pytest.mark.parametrize("model", MODELS)
|
182
|
+
def test_track_stream(model):
|
181
183
|
"""
|
182
184
|
Test streaming tracking on a short 10 frame video using ByteTrack tracker and different GMC methods.
|
183
185
|
|
184
186
|
Note imgsz=160 required for tracking for higher confidence and better matches.
|
185
187
|
"""
|
188
|
+
if model == "yolo11n-cls.pt": # classification model not supported for tracking
|
189
|
+
return
|
186
190
|
video_url = "https://github.com/ultralytics/assets/releases/download/v0.0.0/decelera_portrait_min.mov"
|
187
|
-
model = YOLO(
|
191
|
+
model = YOLO(model)
|
188
192
|
model.track(video_url, imgsz=160, tracker="bytetrack.yaml")
|
189
193
|
model.track(video_url, imgsz=160, tracker="botsort.yaml", save_frames=True) # test frame saving also
|
190
194
|
|
@@ -196,9 +200,10 @@ def test_track_stream():
|
|
196
200
|
model.track(video_url, imgsz=160, tracker=custom_yaml)
|
197
201
|
|
198
202
|
|
199
|
-
|
203
|
+
@pytest.mark.parametrize("task,model,data", TASK_MODEL_DATA)
|
204
|
+
def test_val(task: str, model: str, data: str) -> None:
|
200
205
|
"""Test the validation mode of the YOLO model."""
|
201
|
-
metrics = YOLO(
|
206
|
+
metrics = YOLO(model).val(data=data, imgsz=32)
|
202
207
|
metrics.to_df()
|
203
208
|
metrics.to_csv()
|
204
209
|
metrics.to_xml()
|
@@ -268,7 +273,7 @@ def test_predict_callback_and_setup():
|
|
268
273
|
|
269
274
|
|
270
275
|
@pytest.mark.parametrize("model", MODELS)
|
271
|
-
def test_results(model):
|
276
|
+
def test_results(model: str):
|
272
277
|
"""Test YOLO model results processing and output in various formats."""
|
273
278
|
temp_s = "https://ultralytics.com/images/boats.jpg" if model == "yolo11n-obb.pt" else SOURCE
|
274
279
|
results = YOLO(WEIGHTS_DIR / model)([temp_s, temp_s], imgsz=160)
|
@@ -699,3 +704,28 @@ def test_multichannel():
|
|
699
704
|
im = np.zeros((32, 32, 10), dtype=np.uint8)
|
700
705
|
model.predict(source=im, imgsz=32, save_txt=True, save_crop=True, augment=True)
|
701
706
|
model.export(format="onnx")
|
707
|
+
|
708
|
+
|
709
|
+
@pytest.mark.parametrize("task,model,data", TASK_MODEL_DATA)
|
710
|
+
def test_grayscale(task: str, model: str, data: str) -> None:
|
711
|
+
"""Test YOLO model grayscale training, validation, and prediction functionality."""
|
712
|
+
if task == "classify": # not support grayscale classification yet
|
713
|
+
return
|
714
|
+
grayscale_data = Path(TMP) / f"{Path(data).stem}-grayscale.yaml"
|
715
|
+
data = YAML.load(checks.check_file(data))
|
716
|
+
data["channels"] = 1 # add additional channels key for grayscale
|
717
|
+
YAML.save(grayscale_data, data)
|
718
|
+
# remove npy files in train/val splits if exists, might be created by previous tests
|
719
|
+
for split in {"train", "val"}:
|
720
|
+
for npy_file in (Path(data["path"]) / data[split]).glob("*.npy"):
|
721
|
+
npy_file.unlink()
|
722
|
+
|
723
|
+
model = YOLO(model)
|
724
|
+
model.train(data=grayscale_data, epochs=1, imgsz=32, close_mosaic=1)
|
725
|
+
model.val(data=grayscale_data)
|
726
|
+
im = np.zeros((32, 32, 1), dtype=np.uint8)
|
727
|
+
model.predict(source=im, imgsz=32, save_txt=True, save_crop=True, augment=True)
|
728
|
+
export_model = model.export(format="onnx")
|
729
|
+
|
730
|
+
model = YOLO(export_model, task=task)
|
731
|
+
model.predict(source=im, imgsz=32)
|
ultralytics/__init__.py
CHANGED
ultralytics/cfg/__init__.py
CHANGED
@@ -0,0 +1,103 @@
|
|
1
|
+
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2
|
+
|
3
|
+
# COCO8-Grayscale dataset (first 8 images from COCO train2017) by Ultralytics
|
4
|
+
# Documentation: https://docs.ultralytics.com/datasets/detect/coco8-grayscale/
|
5
|
+
# Example usage: yolo train data=coco8-grayscale.yaml
|
6
|
+
# parent
|
7
|
+
# ├── ultralytics
|
8
|
+
# └── datasets
|
9
|
+
# └── coco8-grayscale ← downloads here (1 MB)
|
10
|
+
|
11
|
+
# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
|
12
|
+
path: ../datasets/coco8-grayscale # dataset root dir
|
13
|
+
train: images/train # train images (relative to 'path') 4 images
|
14
|
+
val: images/val # val images (relative to 'path') 4 images
|
15
|
+
test: # test images (optional)
|
16
|
+
|
17
|
+
channels: 1
|
18
|
+
|
19
|
+
# Classes
|
20
|
+
names:
|
21
|
+
0: person
|
22
|
+
1: bicycle
|
23
|
+
2: car
|
24
|
+
3: motorcycle
|
25
|
+
4: airplane
|
26
|
+
5: bus
|
27
|
+
6: train
|
28
|
+
7: truck
|
29
|
+
8: boat
|
30
|
+
9: traffic light
|
31
|
+
10: fire hydrant
|
32
|
+
11: stop sign
|
33
|
+
12: parking meter
|
34
|
+
13: bench
|
35
|
+
14: bird
|
36
|
+
15: cat
|
37
|
+
16: dog
|
38
|
+
17: horse
|
39
|
+
18: sheep
|
40
|
+
19: cow
|
41
|
+
20: elephant
|
42
|
+
21: bear
|
43
|
+
22: zebra
|
44
|
+
23: giraffe
|
45
|
+
24: backpack
|
46
|
+
25: umbrella
|
47
|
+
26: handbag
|
48
|
+
27: tie
|
49
|
+
28: suitcase
|
50
|
+
29: frisbee
|
51
|
+
30: skis
|
52
|
+
31: snowboard
|
53
|
+
32: sports ball
|
54
|
+
33: kite
|
55
|
+
34: baseball bat
|
56
|
+
35: baseball glove
|
57
|
+
36: skateboard
|
58
|
+
37: surfboard
|
59
|
+
38: tennis racket
|
60
|
+
39: bottle
|
61
|
+
40: wine glass
|
62
|
+
41: cup
|
63
|
+
42: fork
|
64
|
+
43: knife
|
65
|
+
44: spoon
|
66
|
+
45: bowl
|
67
|
+
46: banana
|
68
|
+
47: apple
|
69
|
+
48: sandwich
|
70
|
+
49: orange
|
71
|
+
50: broccoli
|
72
|
+
51: carrot
|
73
|
+
52: hot dog
|
74
|
+
53: pizza
|
75
|
+
54: donut
|
76
|
+
55: cake
|
77
|
+
56: chair
|
78
|
+
57: couch
|
79
|
+
58: potted plant
|
80
|
+
59: bed
|
81
|
+
60: dining table
|
82
|
+
61: toilet
|
83
|
+
62: tv
|
84
|
+
63: laptop
|
85
|
+
64: mouse
|
86
|
+
65: remote
|
87
|
+
66: keyboard
|
88
|
+
67: cell phone
|
89
|
+
68: microwave
|
90
|
+
69: oven
|
91
|
+
70: toaster
|
92
|
+
71: sink
|
93
|
+
72: refrigerator
|
94
|
+
73: book
|
95
|
+
74: clock
|
96
|
+
75: vase
|
97
|
+
76: scissors
|
98
|
+
77: teddy bear
|
99
|
+
78: hair drier
|
100
|
+
79: toothbrush
|
101
|
+
|
102
|
+
# Download script/URL (optional)
|
103
|
+
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/coco8-grayscale.zip
|
ultralytics/data/augment.py
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
import math
|
4
4
|
import random
|
5
5
|
from copy import deepcopy
|
6
|
-
from typing import List, Tuple, Union
|
6
|
+
from typing import Any, Dict, List, Tuple, Union
|
7
7
|
|
8
8
|
import cv2
|
9
9
|
import numpy as np
|
@@ -2416,7 +2416,7 @@ class RandomLoadText:
|
|
2416
2416
|
self.padding = padding
|
2417
2417
|
self.padding_value = padding_value
|
2418
2418
|
|
2419
|
-
def __call__(self, labels:
|
2419
|
+
def __call__(self, labels: Dict[str, Any]) -> Dict[str, Any]:
|
2420
2420
|
"""
|
2421
2421
|
Randomly sample positive and negative texts and update class indices accordingly.
|
2422
2422
|
|
ultralytics/engine/model.py
CHANGED
@@ -634,10 +634,7 @@ class Model(torch.nn.Module):
|
|
634
634
|
self.metrics = validator.metrics
|
635
635
|
return validator.metrics
|
636
636
|
|
637
|
-
def benchmark(
|
638
|
-
self,
|
639
|
-
**kwargs: Any,
|
640
|
-
):
|
637
|
+
def benchmark(self, data=None, format="", verbose=False, **kwargs: Any):
|
641
638
|
"""
|
642
639
|
Benchmark the model across various export formats to evaluate performance.
|
643
640
|
|
@@ -647,14 +644,14 @@ class Model(torch.nn.Module):
|
|
647
644
|
defaults, and any additional user-provided keyword arguments.
|
648
645
|
|
649
646
|
Args:
|
647
|
+
data (str): Path to the dataset for benchmarking.
|
648
|
+
verbose (bool): Whether to print detailed benchmark information.
|
649
|
+
format (str): Export format name for specific benchmarking.
|
650
650
|
**kwargs (Any): Arbitrary keyword arguments to customize the benchmarking process. Common options include:
|
651
|
-
- data (str): Path to the dataset for benchmarking.
|
652
651
|
- imgsz (int | List[int]): Image size for benchmarking.
|
653
652
|
- half (bool): Whether to use half-precision (FP16) mode.
|
654
653
|
- int8 (bool): Whether to use int8 precision mode.
|
655
654
|
- device (str): Device to run the benchmark on (e.g., 'cpu', 'cuda').
|
656
|
-
- verbose (bool): Whether to print detailed benchmark information.
|
657
|
-
- format (str): Export format name for specific benchmarking.
|
658
655
|
|
659
656
|
Returns:
|
660
657
|
(dict): A dictionary containing the results of the benchmarking process, including metrics for
|
@@ -671,17 +668,21 @@ class Model(torch.nn.Module):
|
|
671
668
|
self._check_is_pytorch_model()
|
672
669
|
from ultralytics.utils.benchmarks import benchmark
|
673
670
|
|
671
|
+
from .exporter import export_formats
|
672
|
+
|
674
673
|
custom = {"verbose": False} # method defaults
|
675
674
|
args = {**DEFAULT_CFG_DICT, **self.model.args, **custom, **kwargs, "mode": "benchmark"}
|
675
|
+
fmts = export_formats()
|
676
|
+
export_args = set(dict(zip(fmts["Argument"], fmts["Arguments"])).get(format, [])) - {"batch"}
|
677
|
+
export_kwargs = {k: v for k, v in args.items() if k in export_args}
|
676
678
|
return benchmark(
|
677
679
|
model=self,
|
678
|
-
data=
|
680
|
+
data=data, # if no 'data' argument passed set data=None for default datasets
|
679
681
|
imgsz=args["imgsz"],
|
680
|
-
half=args["half"],
|
681
|
-
int8=args["int8"],
|
682
682
|
device=args["device"],
|
683
|
-
verbose=
|
684
|
-
format=
|
683
|
+
verbose=verbose,
|
684
|
+
format=format,
|
685
|
+
**export_kwargs,
|
685
686
|
)
|
686
687
|
|
687
688
|
def export(
|
@@ -1032,7 +1033,7 @@ class Model(torch.nn.Module):
|
|
1032
1033
|
self.callbacks[event] = [callbacks.default_callbacks[event][0]]
|
1033
1034
|
|
1034
1035
|
@staticmethod
|
1035
|
-
def _reset_ckpt_args(args:
|
1036
|
+
def _reset_ckpt_args(args: Dict[str, Any]) -> Dict[str, Any]:
|
1036
1037
|
"""
|
1037
1038
|
Reset specific arguments when loading a PyTorch model checkpoint.
|
1038
1039
|
|
ultralytics/engine/results.py
CHANGED
@@ -558,7 +558,7 @@ class Results(SimpleClass, DataExportMixin):
|
|
558
558
|
)
|
559
559
|
idx = (
|
560
560
|
pred_boxes.id
|
561
|
-
if pred_boxes.
|
561
|
+
if pred_boxes.is_track and color_mode == "instance"
|
562
562
|
else pred_boxes.cls
|
563
563
|
if pred_boxes and color_mode == "class"
|
564
564
|
else reversed(range(len(pred_masks)))
|
@@ -568,10 +568,10 @@ class Results(SimpleClass, DataExportMixin):
|
|
568
568
|
# Plot Detect results
|
569
569
|
if pred_boxes is not None and show_boxes:
|
570
570
|
for i, d in enumerate(reversed(pred_boxes)):
|
571
|
-
c, d_conf, id = int(d.cls), float(d.conf) if conf else None,
|
571
|
+
c, d_conf, id = int(d.cls), float(d.conf) if conf else None, int(d.id.item()) if d.is_track else None
|
572
572
|
name = ("" if id is None else f"id:{id} ") + names[c]
|
573
573
|
label = (f"{name} {d_conf:.2f}" if conf else name) if labels else None
|
574
|
-
box = d.xyxyxyxy.
|
574
|
+
box = d.xyxyxyxy.squeeze() if is_obb else d.xyxy.squeeze()
|
575
575
|
annotator.box_label(
|
576
576
|
box,
|
577
577
|
label,
|
@@ -733,7 +733,7 @@ class Results(SimpleClass, DataExportMixin):
|
|
733
733
|
elif boxes:
|
734
734
|
# Detect/segment/pose
|
735
735
|
for j, d in enumerate(boxes):
|
736
|
-
c, conf, id = int(d.cls), float(d.conf),
|
736
|
+
c, conf, id = int(d.cls), float(d.conf), int(d.id.item()) if d.is_track else None
|
737
737
|
line = (c, *(d.xyxyxyxyn.view(-1) if is_obb else d.xywhn.view(-1)))
|
738
738
|
if masks:
|
739
739
|
seg = masks[j].xyn[0].copy().reshape(-1) # reversed mask.xyn, (n,2) to (n*2)
|
ultralytics/engine/validator.py
CHANGED
ultralytics/models/nas/model.py
CHANGED
@@ -1,12 +1,4 @@
|
|
1
1
|
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2
|
-
"""
|
3
|
-
YOLO-NAS model interface.
|
4
|
-
|
5
|
-
Examples:
|
6
|
-
>>> from ultralytics import NAS
|
7
|
-
>>> model = NAS("yolo_nas_s")
|
8
|
-
>>> results = model.predict("ultralytics/assets/bus.jpg")
|
9
|
-
"""
|
10
2
|
|
11
3
|
from pathlib import Path
|
12
4
|
from typing import Any, Dict
|
@@ -106,14 +106,10 @@ class ClassificationValidator(BaseValidator):
|
|
106
106
|
self.pred.append(preds.argsort(1, descending=True)[:, :n5].type(torch.int32).cpu())
|
107
107
|
self.targets.append(batch["cls"].type(torch.int32).cpu())
|
108
108
|
|
109
|
-
def finalize_metrics(self
|
109
|
+
def finalize_metrics(self) -> None:
|
110
110
|
"""
|
111
111
|
Finalize metrics including confusion matrix and processing speed.
|
112
112
|
|
113
|
-
Args:
|
114
|
-
*args (Any): Variable length argument list.
|
115
|
-
**kwargs (Any): Arbitrary keyword arguments.
|
116
|
-
|
117
113
|
Notes:
|
118
114
|
This method processes the accumulated predictions and targets to generate the confusion matrix,
|
119
115
|
optionally plots it, and updates the metrics object with speed information.
|