dgenerate-ultralytics-headless 8.3.221__py3-none-any.whl → 8.3.223__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.
Files changed (29) hide show
  1. {dgenerate_ultralytics_headless-8.3.221.dist-info → dgenerate_ultralytics_headless-8.3.223.dist-info}/METADATA +2 -2
  2. {dgenerate_ultralytics_headless-8.3.221.dist-info → dgenerate_ultralytics_headless-8.3.223.dist-info}/RECORD +29 -27
  3. tests/test_python.py +5 -5
  4. ultralytics/__init__.py +1 -1
  5. ultralytics/cfg/datasets/ImageNet.yaml +1 -1
  6. ultralytics/cfg/datasets/lvis.yaml +5 -5
  7. ultralytics/cfg/datasets/open-images-v7.yaml +1 -1
  8. ultralytics/data/base.py +1 -1
  9. ultralytics/data/utils.py +1 -1
  10. ultralytics/engine/exporter.py +46 -110
  11. ultralytics/engine/model.py +1 -1
  12. ultralytics/engine/trainer.py +1 -1
  13. ultralytics/models/rtdetr/val.py +1 -1
  14. ultralytics/models/yolo/classify/train.py +2 -2
  15. ultralytics/nn/autobackend.py +1 -1
  16. ultralytics/nn/modules/head.py +5 -30
  17. ultralytics/utils/__init__.py +4 -4
  18. ultralytics/utils/benchmarks.py +3 -1
  19. ultralytics/utils/export/__init__.py +4 -239
  20. ultralytics/utils/export/engine.py +240 -0
  21. ultralytics/utils/export/imx.py +39 -28
  22. ultralytics/utils/export/tensorflow.py +221 -0
  23. ultralytics/utils/metrics.py +2 -2
  24. ultralytics/utils/nms.py +4 -2
  25. ultralytics/utils/plotting.py +1 -1
  26. {dgenerate_ultralytics_headless-8.3.221.dist-info → dgenerate_ultralytics_headless-8.3.223.dist-info}/WHEEL +0 -0
  27. {dgenerate_ultralytics_headless-8.3.221.dist-info → dgenerate_ultralytics_headless-8.3.223.dist-info}/entry_points.txt +0 -0
  28. {dgenerate_ultralytics_headless-8.3.221.dist-info → dgenerate_ultralytics_headless-8.3.223.dist-info}/licenses/LICENSE +0 -0
  29. {dgenerate_ultralytics_headless-8.3.221.dist-info → dgenerate_ultralytics_headless-8.3.223.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.221
3
+ Version: 8.3.223
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>
@@ -44,7 +44,7 @@ Requires-Dist: torch!=2.4.0,>=1.8.0; sys_platform == "win32"
44
44
  Requires-Dist: torchvision>=0.9.0
45
45
  Requires-Dist: psutil
46
46
  Requires-Dist: polars
47
- Requires-Dist: ultralytics-thop>=2.0.0
47
+ Requires-Dist: ultralytics-thop>=2.0.18
48
48
  Provides-Extra: dev
49
49
  Requires-Dist: ipython; extra == "dev"
50
50
  Requires-Dist: pytest; extra == "dev"
@@ -1,4 +1,4 @@
1
- dgenerate_ultralytics_headless-8.3.221.dist-info/licenses/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
1
+ dgenerate_ultralytics_headless-8.3.223.dist-info/licenses/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
2
2
  tests/__init__.py,sha256=bCox_hLdGRFYGLb2kd722VdNP2zEXNYNuLLYtqZSrbw,804
3
3
  tests/conftest.py,sha256=oaqn_-8LH7R4YQAKKOiK3iuAfjmmLQ9-pL_IPj6xq-U,2333
4
4
  tests/test_cli.py,sha256=zygPlaksok7Nwugp3aIudDSkOlzISvmDWfKNmpY3mSA,5844
@@ -6,9 +6,9 @@ tests/test_cuda.py,sha256=6zUSwu3xaYiO3RRNyDkNsuyeq47b1e9f6JNhPZVeDL4,8142
6
6
  tests/test_engine.py,sha256=ER2DsHM0GfUG99AH1Q-Lpm4x36qxkfOzxmH6uYM75ds,5722
7
7
  tests/test_exports.py,sha256=OMLio2uUhyqo8D8qB5xUwmk7Po2rMeAACRc8WYoxbj4,13147
8
8
  tests/test_integrations.py,sha256=6QgSh9n0J04RdUYz08VeVOnKmf4S5MDEQ0chzS7jo_c,6220
9
- tests/test_python.py,sha256=E5Jft-fJ2S6TFEWHkNWEsZ8N3fp6ap0Dpa9zHWCSsMo,27735
9
+ tests/test_python.py,sha256=OChceQcDDAy07yACnmOoGfimRo_4YdyiMwukGEgozXA,27735
10
10
  tests/test_solutions.py,sha256=j_PZZ5tMR1Y5ararY-OTXZr1hYJ7vEVr8H3w4O1tbQs,14153
11
- ultralytics/__init__.py,sha256=C9rXBpAg_ChwEIbZd1rcopKDZ6FEAK3LzWx_9Tv-quI,1302
11
+ ultralytics/__init__.py,sha256=IFuXT77f7jmVOvOHnLjLEIrgQ-RfhI6Rq7ykdDC42GI,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
@@ -19,7 +19,7 @@ ultralytics/cfg/datasets/DOTAv1.5.yaml,sha256=VZ_KKFX0H2YvlFVJ8JHcLWYBZ2xiQ6Z-RO
19
19
  ultralytics/cfg/datasets/DOTAv1.yaml,sha256=JrDuYcQ0JU9lJlCA-dCkMNko_jaj6MAVGHjsfjeZ_u0,1181
20
20
  ultralytics/cfg/datasets/GlobalWheat2020.yaml,sha256=dnr_loeYSE6Eo_f7V1yubILsMRBMRm1ozyC5r7uT-iY,2144
21
21
  ultralytics/cfg/datasets/HomeObjects-3K.yaml,sha256=xEtSqEad-rtfGuIrERjjhdISggmPlvaX-315ZzKz50I,934
22
- ultralytics/cfg/datasets/ImageNet.yaml,sha256=GvDWypLVG_H3H67Ai8IC1pvK6fwcTtF5FRhzO1OXXDU,42530
22
+ ultralytics/cfg/datasets/ImageNet.yaml,sha256=N9NHhIgnlNIBqZZbzQZAW3aCnz6RSXQABnopaDs5BmE,42529
23
23
  ultralytics/cfg/datasets/Objects365.yaml,sha256=8Bl-NAm0mlMW8EfMsz39JZo-HCvmp0ejJXaMeoHTpqw,9649
24
24
  ultralytics/cfg/datasets/SKU-110K.yaml,sha256=xvRkq3SdDOwBA91U85bln7HTXkod5MvFX6pt1PxTjJE,2609
25
25
  ultralytics/cfg/datasets/VOC.yaml,sha256=84BaL-iwG03M_W9hNzjgEQi918dZgSHbCgf9DShjwLA,3747
@@ -42,9 +42,9 @@ ultralytics/cfg/datasets/dog-pose.yaml,sha256=BI-2S3_cSVyV2Gfzbs_3GzvivRlikT0ANj
42
42
  ultralytics/cfg/datasets/dota8-multispectral.yaml,sha256=2lMBi1Q3_pc0auK00yX80oF7oUMo0bUlwjkOrp33hvs,1216
43
43
  ultralytics/cfg/datasets/dota8.yaml,sha256=5n4h_4zdrtUSkmH5DHJ-JLPvfiATcieIkgP3NeOP5nI,1060
44
44
  ultralytics/cfg/datasets/hand-keypoints.yaml,sha256=NglEDsfNRe0DaYnwy7n6hYUxEAjV-V2NZBUbj1qJaag,1365
45
- ultralytics/cfg/datasets/lvis.yaml,sha256=lMvPfuiDv_o2qLxAWoh9WMrvjKJ5moLrcx1gr3RG_pM,29680
45
+ ultralytics/cfg/datasets/lvis.yaml,sha256=RescdwAJ8EU1o7Sm0YlxYsGbQFNU1p-LFbFKYEt5MhE,29596
46
46
  ultralytics/cfg/datasets/medical-pills.yaml,sha256=RK7iQFpDDkUS6EsEGqlbFjoohi3cgSsUIbsk7UItyds,792
47
- ultralytics/cfg/datasets/open-images-v7.yaml,sha256=wK9v3OAGdHORkFdqoBi0hS0fa1b74LLroAzUSWjxEqw,12119
47
+ ultralytics/cfg/datasets/open-images-v7.yaml,sha256=2fVFmb8UEYH-LkX0z5GlYp__U0_GDqVgVqzmnfFerm8,12116
48
48
  ultralytics/cfg/datasets/package-seg.yaml,sha256=V4uyTDWWzgft24y9HJWuELKuZ5AndAHXbanxMI6T8GU,849
49
49
  ultralytics/cfg/datasets/signature.yaml,sha256=gBvU3715gVxVAafI_yaYczGX3kfEfA4BttbiMkgOXNk,774
50
50
  ultralytics/cfg/datasets/tiger-pose.yaml,sha256=bJ7nBTDQwXRHtlg3xmo4C2bOpPn_r4l8-DezSWMYNcU,1196
@@ -109,24 +109,24 @@ ultralytics/cfg/trackers/bytetrack.yaml,sha256=7LS1ObP5u7BUFcmeY6L2m3bRuPUktnpJs
109
109
  ultralytics/data/__init__.py,sha256=ToR8zl0JhBHy42ZvV7zIwO_F3lbi5oNlGQNPK3dlddU,644
110
110
  ultralytics/data/annotator.py,sha256=f15TCDEM8SuuzHiFB8oyhTy9vfywKmPTLSPAgsZQP9I,2990
111
111
  ultralytics/data/augment.py,sha256=XGnatX9V8mdTCeVRvFt6I_NVng02N9-sWQgqHZd57Mk,132918
112
- ultralytics/data/base.py,sha256=wf6c7Inhfz2kOTn-y5QvS8iPulnPSRMws06kE2Z4ipo,19662
112
+ ultralytics/data/base.py,sha256=JHu6T6P_29kR_83IxXQdMhEDNW--VOXNvHxMuzSQqtA,19661
113
113
  ultralytics/data/build.py,sha256=a-Gs2JbZS9k59CpJaax7kby-PuZOeK1NYV4mq4KRFA0,16688
114
114
  ultralytics/data/converter.py,sha256=EPVgUY8que3TaQo6Sxx-OOUIZulVNBaw1MIdGBUZECs,31963
115
115
  ultralytics/data/dataset.py,sha256=HQ3r6Slu4LHSNXnRCiOgbs2zC2E2uAQkYnHZhV3JGdE,36772
116
116
  ultralytics/data/loaders.py,sha256=lTnKDRtwZ9IRpZbH2BO8WVHlDuKeTp5ExVBvbUDbdMA,31732
117
117
  ultralytics/data/split.py,sha256=5ubnL_wsEutFQOj4I4K01L9UpZrrO_vO3HrydSLJyIY,5107
118
118
  ultralytics/data/split_dota.py,sha256=Lz04qVufTvHn4cTyo3VkqoIM93rb-Ymr8uOIXeSsaJI,12910
119
- ultralytics/data/utils.py,sha256=7_HpSo4tF9ToRzG9EQXhuw4GCusGPOXBmWGw3h6Gp_A,36931
119
+ ultralytics/data/utils.py,sha256=kaLibRb80PB_KCLxNGL8H6X-7x_KUq-RGn-yoi1UU8c,36930
120
120
  ultralytics/data/scripts/download_weights.sh,sha256=0y8XtZxOru7dVThXDFUXLHBuICgOIqZNUwpyL4Rh6lg,595
121
121
  ultralytics/data/scripts/get_coco.sh,sha256=UuJpJeo3qQpTHVINeOpmP0NYmg8PhEFE3A8J3jKrnPw,1768
122
122
  ultralytics/data/scripts/get_coco128.sh,sha256=qmRQl_hOKrsdHrTrnyQuFIH01oDz3lfaz138OgGfLt8,650
123
123
  ultralytics/data/scripts/get_imagenet.sh,sha256=hr42H16bM47iT27rgS7MpEo-GeOZAYUQXgr0B2cwn48,1705
124
124
  ultralytics/engine/__init__.py,sha256=lm6MckFYCPTbqIoX7w0s_daxdjNeBeKW6DXppv1-QUM,70
125
- ultralytics/engine/exporter.py,sha256=dFbnKY_6Ym0aY6gk1GYspgGTHI6UA6LSLUJaxAAwPDU,73543
126
- ultralytics/engine/model.py,sha256=sCa5W6Qit5NloEVuuvNelH-geJQw9IGjcOc9_PXNDnI,53456
125
+ ultralytics/engine/exporter.py,sha256=89hggNbcH7zFAG8QJmShoHFZMvn0SpHF_yTEJ4CMbsc,69852
126
+ ultralytics/engine/model.py,sha256=d7yGl8ybd7v8W4Q-ueSDAVfumDhsx0QCp4mx8OKf0Z8,53448
127
127
  ultralytics/engine/predictor.py,sha256=ZQrx1Bz4X8aTgGjrOSdRSP7SCtQ05uqz6IitEan_Gyk,22813
128
128
  ultralytics/engine/results.py,sha256=oHQdV_eIMvAU2qLCV7wG7iLifdfaLEgP80lDXB5ghkg,71490
129
- ultralytics/engine/trainer.py,sha256=crS7HL4sLOeXn_51_2mKBfeC5jfR6GeT-1qNgblD7dQ,44140
129
+ ultralytics/engine/trainer.py,sha256=EoJY-fsZBC8sGiHFVVgrHVioRX589Jng5Mg-eqTg7e0,44139
130
130
  ultralytics/engine/tuner.py,sha256=vc_Y26g5vzuIeSQBUPOwyVWNT6DumpEDGLvYygdq_kY,21659
131
131
  ultralytics/engine/validator.py,sha256=HoBE5Lc7Ro7IQ5TlfDC94L5BmdOb8J8yfGlELozZ6EM,17560
132
132
  ultralytics/hub/__init__.py,sha256=2BzU31EQXxnRL9r3BgUFsskf_o_FgTBTi4az58frNNM,6741
@@ -148,7 +148,7 @@ ultralytics/models/rtdetr/__init__.py,sha256=F4NEQqtcVKFxj97Dh7rkn2Vu3JG4Ea_nxqr
148
148
  ultralytics/models/rtdetr/model.py,sha256=Pq9QDgaZetDnjxdYSoomj2s6vOGSdpsqVfyN5j0GUmc,2292
149
149
  ultralytics/models/rtdetr/predict.py,sha256=43-gGCHEH7UQQ6H1oXdlDlrM39esnp-YEhqCvZOwtOM,4279
150
150
  ultralytics/models/rtdetr/train.py,sha256=SNntxGHXatbNqn1yna5_dDQiR_ciDK6o_4S7JIHU7EY,3765
151
- ultralytics/models/rtdetr/val.py,sha256=l26CzpcYHYC0sQ--rKUFBCYl73nsgAGOj1U3xScNzFs,8918
151
+ ultralytics/models/rtdetr/val.py,sha256=UXaoNiy81zdkv6d79x1oGyR8T7dwuV5Y4m0Gpe-LQts,8976
152
152
  ultralytics/models/sam/__init__.py,sha256=p1BKLawQFvVxmdk7LomFVWX-67Kc-AP4PJBNPfU_Nuc,359
153
153
  ultralytics/models/sam/amg.py,sha256=nFq4EwHf65W2N5Ipo4W69nGRhCbJEh_boYQ8SIPWBZ0,11816
154
154
  ultralytics/models/sam/build.py,sha256=uKCgHpcYgV26OFuMq5RaGR8aXYoEtNoituT06bmnW44,12790
@@ -170,7 +170,7 @@ ultralytics/models/yolo/__init__.py,sha256=YD407NDDiyjo0x_MR6usJaTpePKPgsfBUYehl
170
170
  ultralytics/models/yolo/model.py,sha256=PH8nXl0ZulgjWMr9M-XAK2TcdaBNXX5AzofIhcKbTQ0,18840
171
171
  ultralytics/models/yolo/classify/__init__.py,sha256=9--HVaNOfI1K7rn_rRqclL8FUAnpfeBrRqEQIaQw2xM,383
172
172
  ultralytics/models/yolo/classify/predict.py,sha256=o7pDE8xwjkHUUIIOph7ZVQZyGZyob24dYDQ460v_7R0,4149
173
- ultralytics/models/yolo/classify/train.py,sha256=9o-UDqiLZwL2fzYAenAgInngZhiIMj0mVWAfa490jbw,9028
173
+ ultralytics/models/yolo/classify/train.py,sha256=afjxs_CCvBgCKgcJoxmPA7vYUkHhpETn1Wwqdm7vasI,9026
174
174
  ultralytics/models/yolo/classify/val.py,sha256=VbjlFQf219gFGxu0Gx0PYH2v31c4HxvM4BnH5AqWzOE,10828
175
175
  ultralytics/models/yolo/detect/__init__.py,sha256=GIRsLYR-kT4JJx7lh4ZZAFGBZj0aebokuU0A7JbjDVA,257
176
176
  ultralytics/models/yolo/detect/predict.py,sha256=Vtpqb2gHI7hv9TaBBXsnoScQ8HrSnj0PPOkEu07MwLc,5394
@@ -197,14 +197,14 @@ ultralytics/models/yolo/yoloe/train.py,sha256=qefvNNXDTOK1tO3va0kNHr8lE5QJkOlV8G
197
197
  ultralytics/models/yolo/yoloe/train_seg.py,sha256=aCV7M8oQOvODFnU4piZdJh3tIrBJYAzZfRVRx1vRgxo,4956
198
198
  ultralytics/models/yolo/yoloe/val.py,sha256=5Gd9EoFH0FmKKvWXBl4J7gBe9DVxIczN-s3ceHwdUDo,9458
199
199
  ultralytics/nn/__init__.py,sha256=538LZPUKKvc3JCMgiQ4VLGqRN2ZAaVLFcQbeNNHFkEA,545
200
- ultralytics/nn/autobackend.py,sha256=918iNweM3fTuRIbxHbXC1wspOj9rlGkuwalQ61uYLbk,42694
200
+ ultralytics/nn/autobackend.py,sha256=gw8REfburF36l9Hyh11eYzy7UnMvuX1Dm3cjsJBA1TM,42702
201
201
  ultralytics/nn/tasks.py,sha256=vRr6HTucM7Eg3kxzhYtyjgEAdacZ7gIDU3yPbMnyYMM,70834
202
202
  ultralytics/nn/text_model.py,sha256=pHqnKe8UueR1MuwJcIE_IvrnYIlt68QL796xjcRJs2A,15275
203
203
  ultralytics/nn/modules/__init__.py,sha256=5Sg_28MDfKwdu14Ty_WCaiIXZyjBSQ-xCNCwnoz_w-w,3198
204
204
  ultralytics/nn/modules/activation.py,sha256=75JcIMH2Cu9GTC2Uf55r_5YLpxcrXQDaVoeGQ0hlUAU,2233
205
205
  ultralytics/nn/modules/block.py,sha256=eQ8DegyvBG9k-O_QgSZe5XGmpravqwlnSCCBW6bHRXo,70622
206
206
  ultralytics/nn/modules/conv.py,sha256=MISNAK8NzAZhNUusVKWvTHQ8IsofwM-5X0gChCagsaY,21457
207
- ultralytics/nn/modules/head.py,sha256=HBSoHOcd9hikpBLF9BdgIItYJDNWIO8NiNYMcMw6ThM,53512
207
+ ultralytics/nn/modules/head.py,sha256=XBOLfpxgApIhNmdgnWoECep0wKhrw8LWtmd1TrWNBak,52076
208
208
  ultralytics/nn/modules/transformer.py,sha256=9aq0Yo9V3C4y_McSje4qE1d_PTWDctTsrb98MyXxigc,31470
209
209
  ultralytics/nn/modules/utils.py,sha256=9kLeEtvEBFLugz53TkdI4mifD-39a-upjPD-wrE8opU,6092
210
210
  ultralytics/solutions/__init__.py,sha256=Jj7OcRiYjHH-e104H4xTgjjR5W6aPB4mBRndbaSPmgU,1209
@@ -237,10 +237,10 @@ ultralytics/trackers/utils/__init__.py,sha256=lm6MckFYCPTbqIoX7w0s_daxdjNeBeKW6D
237
237
  ultralytics/trackers/utils/gmc.py,sha256=1cCmlbk5Z6Pd-rFCaiJML7o_cUm_IktMuCocTDOMGFQ,14028
238
238
  ultralytics/trackers/utils/kalman_filter.py,sha256=PPmM0lwBMdT_hGojvfLoUsBUFMBBMNRAxKbMcQa3wJ0,21619
239
239
  ultralytics/trackers/utils/matching.py,sha256=eIcqzN6WgvE8A3V83DlyklcWLN386StVieqB-j35TpM,7164
240
- ultralytics/utils/__init__.py,sha256=3NyzCFKTea_9pt7eKRNCp6h0SyFJcEYp3s4bdVJqnwc,53491
240
+ ultralytics/utils/__init__.py,sha256=dXjsJVoQwtoMWCP09h11JaG9oo39zE9kqpN-sgyiZXk,53487
241
241
  ultralytics/utils/autobatch.py,sha256=i6KYLLSItKP1Q2IUlTPHrZhjcxl7UOjs0Seb8bF8pvM,5124
242
242
  ultralytics/utils/autodevice.py,sha256=d9yq6eEn05fdfzfpxeSECd0YEO61er5f7T-0kjLdofg,8843
243
- ultralytics/utils/benchmarks.py,sha256=-JP214Raik0L9pko-D_PLJwU_PZsNNuEuYLsZ3LJNTQ,32124
243
+ ultralytics/utils/benchmarks.py,sha256=icNEzwAtlDDQMmgZkCcax0mFKV_LJWMfu0hvNVYoxT4,32233
244
244
  ultralytics/utils/checks.py,sha256=QyQglwJBi-SYA0lomfq6FFvkvOuyd9Vz_qmz0SMdHII,36272
245
245
  ultralytics/utils/cpu.py,sha256=OPlVxROWhQp-kEa9EkeNRKRQ-jz0KwySu5a-h91JZjk,3634
246
246
  ultralytics/utils/dist.py,sha256=5xQhWK0OLORvseAL08UmG1LYdkiDVLquxmaGSnqiSqo,4151
@@ -252,11 +252,11 @@ ultralytics/utils/git.py,sha256=yYJH7vdWHBag1boyqYJEbwtDPdkUK4jz4cU62UY48gU,5512
252
252
  ultralytics/utils/instance.py,sha256=_b_jMTECWJGzncCiTg7FtTDSSeXGnbiAhaJhIsqbn9k,19043
253
253
  ultralytics/utils/logger.py,sha256=hK1APBBHmlLAm0zbAFY7gf7Iaejy0PdwLWnnpboboGg,15129
254
254
  ultralytics/utils/loss.py,sha256=wJ0F2DpRTI9-e9adxIm2io0zcXRa0RTWFTOc7WmS1-A,39827
255
- ultralytics/utils/metrics.py,sha256=8D1BTd0KL-2uymHDdmxIbuni1PqDNBfZYCZTA2P3vH0,68882
256
- ultralytics/utils/nms.py,sha256=AVOmPuUTEJqmq2J6rvjq-nHNxYIyabgzHdc41siyA0w,14161
255
+ ultralytics/utils/metrics.py,sha256=EWwkVWNmN_9rIsR1UOTLz3PiXOzflUE0iWFibydvXgM,68882
256
+ ultralytics/utils/nms.py,sha256=SnZF0VRzY933YzI92NLzmLwuVzu56UNZ7sFT0FryCaw,14285
257
257
  ultralytics/utils/ops.py,sha256=yb0jlahjxqUT_xb3y9wz0kXn0rx2AryUgWdtLat3yWY,27010
258
258
  ultralytics/utils/patches.py,sha256=0-2G4jXCIPnMonlft-cPcjfFcOXQS6ODwUDNUwanfg4,6541
259
- ultralytics/utils/plotting.py,sha256=kzYd5nyUklXdNiUFoHoKCRMuhxqPk1-2-hhO_twUjDw,48369
259
+ ultralytics/utils/plotting.py,sha256=l5G4MT2pB_LLMFqSgFbKb7ip5VMrnpi3i5QmZWytRRU,48369
260
260
  ultralytics/utils/tal.py,sha256=7KQYNyetfx18CNc_bvNG7BDb44CIU3DEu4qziVVvNAE,20869
261
261
  ultralytics/utils/torch_utils.py,sha256=9o0vvqoRQ-F68yDP8xBHx8Re055u4-mNKwFSB1NN-f0,40377
262
262
  ultralytics/utils/tqdm.py,sha256=ny5RIg2OTkWQ7gdaXfYaoIgR0Xn2_hNGB6tUpO2Unns,16137
@@ -274,10 +274,12 @@ ultralytics/utils/callbacks/platform.py,sha256=a7T_8htoBB0uX1WIc392UJnhDjxkRyQMv
274
274
  ultralytics/utils/callbacks/raytune.py,sha256=S6Bq16oQDQ8BQgnZzA0zJHGN_BBr8iAM_WtGoLiEcwg,1283
275
275
  ultralytics/utils/callbacks/tensorboard.py,sha256=_4nfGK1dDLn6ijpvphBDhc-AS8qhS3jjY2CAWB7SNF0,5283
276
276
  ultralytics/utils/callbacks/wb.py,sha256=ngQO8EJ1kxJDF1YajScVtzBbm26jGuejA0uWeOyvf5A,7685
277
- ultralytics/utils/export/__init__.py,sha256=uyRhb-0Z5FVf7vSz2Yba1m7g5m2U_ftAv4ThlmMsqZ8,10015
278
- ultralytics/utils/export/imx.py,sha256=Jl5nuNxqaP_bY5yrV2NypmoJSrexHE71TxR72SDdjcg,11394
279
- dgenerate_ultralytics_headless-8.3.221.dist-info/METADATA,sha256=h8s7jJqH_s5Gat6HfV2r_S8KTrCIrHRpk0AH20FUXu4,38763
280
- dgenerate_ultralytics_headless-8.3.221.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
281
- dgenerate_ultralytics_headless-8.3.221.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
282
- dgenerate_ultralytics_headless-8.3.221.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
283
- dgenerate_ultralytics_headless-8.3.221.dist-info/RECORD,,
277
+ ultralytics/utils/export/__init__.py,sha256=Cfh-PwVfTF_lwPp-Ss4wiX4z8Sm1XRPklsqdFfmTZ30,333
278
+ ultralytics/utils/export/engine.py,sha256=V8ERERlpufTRm6k_7KOy9dUupAICC28W9TPO_7dkEJY,9979
279
+ ultralytics/utils/export/imx.py,sha256=DH0rVe-gris7qA7bGT-WoOJHqWxLBAmei1JXmK-W7vM,11660
280
+ ultralytics/utils/export/tensorflow.py,sha256=CxraBn-5pIDSd_-0-0vQGMz8lv75vjSl6N7DYgVS3SU,9382
281
+ dgenerate_ultralytics_headless-8.3.223.dist-info/METADATA,sha256=P2UOqD5tY6Tx3cfHaU_B5oXQPOsycKUo6lThBHn7G0s,38764
282
+ dgenerate_ultralytics_headless-8.3.223.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
283
+ dgenerate_ultralytics_headless-8.3.223.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
284
+ dgenerate_ultralytics_headless-8.3.223.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
285
+ dgenerate_ultralytics_headless-8.3.223.dist-info/RECORD,,
tests/test_python.py CHANGED
@@ -136,23 +136,23 @@ def test_predict_visualize(model):
136
136
  YOLO(WEIGHTS_DIR / model)(SOURCE, imgsz=32, visualize=True)
137
137
 
138
138
 
139
- def test_predict_grey_and_4ch(tmp_path):
140
- """Test YOLO prediction on SOURCE converted to greyscale and 4-channel images with various filenames."""
139
+ def test_predict_gray_and_4ch(tmp_path):
140
+ """Test YOLO prediction on SOURCE converted to grayscale and 4-channel images with various filenames."""
141
141
  im = Image.open(SOURCE)
142
142
 
143
- source_greyscale = tmp_path / "greyscale.jpg"
143
+ source_grayscale = tmp_path / "grayscale.jpg"
144
144
  source_rgba = tmp_path / "4ch.png"
145
145
  source_non_utf = tmp_path / "non_UTF_测试文件_tést_image.jpg"
146
146
  source_spaces = tmp_path / "image with spaces.jpg"
147
147
 
148
- im.convert("L").save(source_greyscale) # greyscale
148
+ im.convert("L").save(source_grayscale) # grayscale
149
149
  im.convert("RGBA").save(source_rgba) # 4-ch PNG with alpha
150
150
  im.save(source_non_utf) # non-UTF characters in filename
151
151
  im.save(source_spaces) # spaces in filename
152
152
 
153
153
  # Inference
154
154
  model = YOLO(MODEL)
155
- for f in source_rgba, source_greyscale, source_non_utf, source_spaces:
155
+ for f in source_rgba, source_grayscale, source_non_utf, source_spaces:
156
156
  for source in Image.open(f), cv2.imread(str(f)), f:
157
157
  results = model(source, save=True, verbose=True, imgsz=32)
158
158
  assert len(results) == 1 # verify that an image was run
ultralytics/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
2
2
 
3
- __version__ = "8.3.221"
3
+ __version__ = "8.3.223"
4
4
 
5
5
  import importlib
6
6
  import os
@@ -342,7 +342,7 @@ names:
342
342
  322: ringlet
343
343
  323: monarch butterfly
344
344
  324: small white
345
- 325: sulphur butterfly
345
+ 325: sulfur butterfly
346
346
  326: gossamer-winged butterfly
347
347
  327: starfish
348
348
  328: sea urchin
@@ -35,7 +35,7 @@ names:
35
35
  17: armband
36
36
  18: armchair
37
37
  19: armoire
38
- 20: armor/armour
38
+ 20: armor
39
39
  21: artichoke
40
40
  22: trash can/garbage can/wastebin/dustbin/trash barrel/trash bin
41
41
  23: ashtray
@@ -245,7 +245,7 @@ names:
245
245
  227: CD player
246
246
  228: celery
247
247
  229: cellular telephone/cellular phone/cellphone/mobile phone/smart phone
248
- 230: chain mail/ring mail/chain armor/chain armour/ring armor/ring armour
248
+ 230: chain mail/ring mail/chain armor/ring armor
249
249
  231: chair
250
250
  232: chaise longue/chaise/daybed
251
251
  233: chalice
@@ -305,7 +305,7 @@ names:
305
305
  287: coin
306
306
  288: colander/cullender
307
307
  289: coleslaw/slaw
308
- 290: coloring material/colouring material
308
+ 290: coloring material
309
309
  291: combination lock
310
310
  292: pacifier/teething ring
311
311
  293: comic book
@@ -401,7 +401,7 @@ names:
401
401
  383: domestic ass/donkey
402
402
  384: doorknob/doorhandle
403
403
  385: doormat/welcome mat
404
- 386: doughnut/donut
404
+ 386: donut
405
405
  387: dove
406
406
  388: dragonfly
407
407
  389: drawer
@@ -1072,7 +1072,7 @@ names:
1072
1072
  1054: tag
1073
1073
  1055: taillight/rear light
1074
1074
  1056: tambourine
1075
- 1057: army tank/armored combat vehicle/armoured combat vehicle
1075
+ 1057: army tank/armored combat vehicle
1076
1076
  1058: tank/tank storage vessel/storage tank
1077
1077
  1059: tank top/tank top clothing
1078
1078
  1060: tape/tape sticky cloth or paper
@@ -182,7 +182,7 @@ names:
182
182
  163: Dolphin
183
183
  164: Door
184
184
  165: Door handle
185
- 166: Doughnut
185
+ 166: Donut
186
186
  167: Dragonfly
187
187
  168: Drawer
188
188
  169: Dress
ultralytics/data/base.py CHANGED
@@ -307,7 +307,7 @@ class BaseDataset(Dataset):
307
307
  b += im.nbytes
308
308
  if not os.access(Path(im_file).parent, os.W_OK):
309
309
  self.cache = None
310
- LOGGER.warning(f"{self.prefix}Skipping caching images to disk, directory not writeable")
310
+ LOGGER.warning(f"{self.prefix}Skipping caching images to disk, directory not writable")
311
311
  return False
312
312
  disk_required = b * self.ni / n * (1 + safety_margin) # bytes required to cache dataset to disk
313
313
  total, _used, free = shutil.disk_usage(Path(self.im_files[0]).parent)
ultralytics/data/utils.py CHANGED
@@ -804,4 +804,4 @@ def save_dataset_cache_file(prefix: str, path: Path, x: dict, version: str):
804
804
  np.save(file, x)
805
805
  LOGGER.info(f"{prefix}New cache created: {path}")
806
806
  else:
807
- LOGGER.warning(f"{prefix}Cache directory {path.parent} is not writeable, cache not saved.")
807
+ LOGGER.warning(f"{prefix}Cache directory {path.parent} is not writable, cache not saved.")
@@ -107,9 +107,17 @@ from ultralytics.utils.checks import (
107
107
  is_intel,
108
108
  is_sudo_available,
109
109
  )
110
- from ultralytics.utils.downloads import attempt_download_asset, get_github_assets, safe_download
111
- from ultralytics.utils.export import onnx2engine, torch2imx, torch2onnx
112
- from ultralytics.utils.files import file_size, spaces_in_path
110
+ from ultralytics.utils.downloads import get_github_assets, safe_download
111
+ from ultralytics.utils.export import (
112
+ keras2pb,
113
+ onnx2engine,
114
+ onnx2saved_model,
115
+ pb2tfjs,
116
+ tflite2edgetpu,
117
+ torch2imx,
118
+ torch2onnx,
119
+ )
120
+ from ultralytics.utils.files import file_size
113
121
  from ultralytics.utils.metrics import batch_probiou
114
122
  from ultralytics.utils.nms import TorchNMS
115
123
  from ultralytics.utils.ops import Profile
@@ -206,15 +214,6 @@ def validate_args(format, passed_args, valid_args):
206
214
  assert arg in valid_args, f"ERROR ❌️ argument '{arg}' is not supported for format='{format}'"
207
215
 
208
216
 
209
- def gd_outputs(gd):
210
- """Return TensorFlow GraphDef model output node names."""
211
- name_list, input_list = [], []
212
- for node in gd.node: # tensorflow.core.framework.node_def_pb2.NodeDef
213
- name_list.append(node.name)
214
- input_list.extend(node.input)
215
- return sorted(f"{x}:0" for x in list(set(name_list) - set(input_list)) if not x.startswith("NoOp"))
216
-
217
-
218
217
  def try_export(inner_func):
219
218
  """YOLO export decorator, i.e. @try_export."""
220
219
  inner_args = get_default_args(inner_func)
@@ -367,11 +366,11 @@ class Exporter:
367
366
  if not self.args.int8:
368
367
  LOGGER.warning("IMX export requires int8=True, setting int8=True.")
369
368
  self.args.int8 = True
370
- if not self.args.nms:
369
+ if not self.args.nms and model.task in {"detect", "pose"}:
371
370
  LOGGER.warning("IMX export requires nms=True, setting nms=True.")
372
371
  self.args.nms = True
373
- if model.task not in {"detect", "pose"}:
374
- raise ValueError("IMX export only supported for detection and pose estimation models.")
372
+ if model.task not in {"detect", "pose", "classify"}:
373
+ raise ValueError("IMX export only supported for detection, pose estimation, and classification models.")
375
374
  if not hasattr(model, "names"):
376
375
  model.names = default_class_names()
377
376
  model.names = check_class_names(model.names)
@@ -396,8 +395,6 @@ class Exporter:
396
395
  assert self.args.name in RKNN_CHIPS, (
397
396
  f"Invalid processor name '{self.args.name}' for Rockchip RKNN export. Valid names are {RKNN_CHIPS}."
398
397
  )
399
- if self.args.int8 and tflite:
400
- assert not getattr(model, "end2end", False), "TFLite INT8 export not supported for end2end models."
401
398
  if self.args.nms:
402
399
  assert not isinstance(model, ClassificationModel), "'nms=True' is not valid for classification models."
403
400
  assert not tflite or not ARM64 or not LINUX, "TFLite export with NMS unsupported on ARM64 Linux"
@@ -463,6 +460,10 @@ class Exporter:
463
460
  from ultralytics.utils.export.imx import FXModel
464
461
 
465
462
  model = FXModel(model, self.imgsz)
463
+ if tflite or edgetpu:
464
+ from ultralytics.utils.export.tensorflow import tf_wrapper
465
+
466
+ model = tf_wrapper(model)
466
467
  for m in model.modules():
467
468
  if isinstance(m, Classify):
468
469
  m.export = True
@@ -644,7 +645,7 @@ class Exporter:
644
645
  assert TORCH_1_13, f"'nms=True' ONNX export requires torch>=1.13 (found torch=={TORCH_VERSION})"
645
646
 
646
647
  f = str(self.file.with_suffix(".onnx"))
647
- output_names = ["output0", "output1"] if isinstance(self.model, SegmentationModel) else ["output0"]
648
+ output_names = ["output0", "output1"] if self.model.task == "segment" else ["output0"]
648
649
  dynamic = self.args.dynamic
649
650
  if dynamic:
650
651
  dynamic = {"images": {0: "batch", 2: "height", 3: "width"}} # shape(1,3,640,640)
@@ -1055,75 +1056,43 @@ class Exporter:
1055
1056
  if f.is_dir():
1056
1057
  shutil.rmtree(f) # delete output folder
1057
1058
 
1058
- # Pre-download calibration file to fix https://github.com/PINTO0309/onnx2tf/issues/545
1059
- onnx2tf_file = Path("calibration_image_sample_data_20x128x128x3_float32.npy")
1060
- if not onnx2tf_file.exists():
1061
- attempt_download_asset(f"{onnx2tf_file}.zip", unzip=True, delete=True)
1059
+ # Export to TF
1060
+ images = None
1061
+ if self.args.int8 and self.args.data:
1062
+ images = [batch["img"] for batch in self.get_int8_calibration_dataloader(prefix)]
1063
+ images = (
1064
+ torch.nn.functional.interpolate(torch.cat(images, 0).float(), size=self.imgsz)
1065
+ .permute(0, 2, 3, 1)
1066
+ .numpy()
1067
+ .astype(np.float32)
1068
+ )
1062
1069
 
1063
1070
  # Export to ONNX
1064
1071
  if isinstance(self.model.model[-1], RTDETRDecoder):
1065
1072
  self.args.opset = self.args.opset or 19
1066
1073
  assert 16 <= self.args.opset <= 19, "RTDETR export requires opset>=16;<=19"
1067
1074
  self.args.simplify = True
1068
- f_onnx = self.export_onnx()
1069
-
1070
- # Export to TF
1071
- np_data = None
1072
- if self.args.int8:
1073
- tmp_file = f / "tmp_tflite_int8_calibration_images.npy" # int8 calibration images file
1074
- if self.args.data:
1075
- f.mkdir()
1076
- images = [batch["img"] for batch in self.get_int8_calibration_dataloader(prefix)]
1077
- images = torch.nn.functional.interpolate(torch.cat(images, 0).float(), size=self.imgsz).permute(
1078
- 0, 2, 3, 1
1079
- )
1080
- np.save(str(tmp_file), images.numpy().astype(np.float32)) # BHWC
1081
- np_data = [["images", tmp_file, [[[[0, 0, 0]]]], [[[[255, 255, 255]]]]]]
1082
-
1083
- import onnx2tf # scoped for after ONNX export for reduced conflict during import
1084
-
1085
- LOGGER.info(f"{prefix} starting TFLite export with onnx2tf {onnx2tf.__version__}...")
1086
- keras_model = onnx2tf.convert(
1087
- input_onnx_file_path=f_onnx,
1088
- output_folder_path=str(f),
1089
- not_use_onnxsim=True,
1090
- verbosity="error", # note INT8-FP16 activation bug https://github.com/ultralytics/ultralytics/issues/15873
1091
- output_integer_quantized_tflite=self.args.int8,
1092
- custom_input_op_name_np_data_path=np_data,
1093
- enable_batchmatmul_unfold=True and not self.args.int8, # fix lower no. of detected objects on GPU delegate
1094
- output_signaturedefs=True, # fix error with Attention block group convolution
1095
- disable_group_convolution=self.args.format in {"tfjs", "edgetpu"}, # fix error with group convolution
1075
+ f_onnx = self.export_onnx() # ensure ONNX is available
1076
+ keras_model = onnx2saved_model(
1077
+ f_onnx,
1078
+ f,
1079
+ int8=self.args.int8,
1080
+ images=images,
1081
+ disable_group_convolution=self.args.format in {"tfjs", "edgetpu"},
1082
+ prefix=prefix,
1096
1083
  )
1097
1084
  YAML.save(f / "metadata.yaml", self.metadata) # add metadata.yaml
1098
-
1099
- # Remove/rename TFLite models
1100
- if self.args.int8:
1101
- tmp_file.unlink(missing_ok=True)
1102
- for file in f.rglob("*_dynamic_range_quant.tflite"):
1103
- file.rename(file.with_name(file.stem.replace("_dynamic_range_quant", "_int8") + file.suffix))
1104
- for file in f.rglob("*_integer_quant_with_int16_act.tflite"):
1105
- file.unlink() # delete extra fp16 activation TFLite files
1106
-
1107
1085
  # Add TFLite metadata
1108
1086
  for file in f.rglob("*.tflite"):
1109
- f.unlink() if "quant_with_int16_act.tflite" in str(f) else self._add_tflite_metadata(file)
1087
+ file.unlink() if "quant_with_int16_act.tflite" in str(file) else self._add_tflite_metadata(file)
1110
1088
 
1111
1089
  return str(f), keras_model # or keras_model = tf.saved_model.load(f, tags=None, options=None)
1112
1090
 
1113
1091
  @try_export
1114
1092
  def export_pb(self, keras_model, prefix=colorstr("TensorFlow GraphDef:")):
1115
1093
  """Export YOLO model to TensorFlow GraphDef *.pb format https://github.com/leimao/Frozen-Graph-TensorFlow."""
1116
- import tensorflow as tf
1117
- from tensorflow.python.framework.convert_to_constants import convert_variables_to_constants_v2
1118
-
1119
- LOGGER.info(f"\n{prefix} starting export with tensorflow {tf.__version__}...")
1120
1094
  f = self.file.with_suffix(".pb")
1121
-
1122
- m = tf.function(lambda x: keras_model(x)) # full model
1123
- m = m.get_concrete_function(tf.TensorSpec(keras_model.inputs[0].shape, keras_model.inputs[0].dtype))
1124
- frozen_func = convert_variables_to_constants_v2(m)
1125
- frozen_func.graph.as_graph_def()
1126
- tf.io.write_graph(graph_or_graph_def=frozen_func.graph, logdir=str(f.parent), name=f.name, as_text=False)
1095
+ keras2pb(keras_model, f, prefix)
1127
1096
  return f
1128
1097
 
1129
1098
  @try_export
@@ -1191,22 +1160,11 @@ class Exporter:
1191
1160
  "sudo apt-get install edgetpu-compiler",
1192
1161
  ):
1193
1162
  subprocess.run(c if is_sudo_available() else c.replace("sudo ", ""), shell=True, check=True)
1194
- ver = subprocess.run(cmd, shell=True, capture_output=True, check=True).stdout.decode().rsplit(maxsplit=1)[-1]
1195
1163
 
1164
+ ver = subprocess.run(cmd, shell=True, capture_output=True, check=True).stdout.decode().rsplit(maxsplit=1)[-1]
1196
1165
  LOGGER.info(f"\n{prefix} starting export with Edge TPU compiler {ver}...")
1166
+ tflite2edgetpu(tflite_file=tflite_model, output_dir=tflite_model.parent, prefix=prefix)
1197
1167
  f = str(tflite_model).replace(".tflite", "_edgetpu.tflite") # Edge TPU model
1198
-
1199
- cmd = (
1200
- "edgetpu_compiler "
1201
- f'--out_dir "{Path(f).parent}" '
1202
- "--show_operations "
1203
- "--search_delegate "
1204
- "--delegate_search_step 30 "
1205
- "--timeout_sec 180 "
1206
- f'"{tflite_model}"'
1207
- )
1208
- LOGGER.info(f"{prefix} running '{cmd}'")
1209
- subprocess.run(cmd, shell=True)
1210
1168
  self._add_tflite_metadata(f)
1211
1169
  return f
1212
1170
 
@@ -1214,31 +1172,10 @@ class Exporter:
1214
1172
  def export_tfjs(self, prefix=colorstr("TensorFlow.js:")):
1215
1173
  """Export YOLO model to TensorFlow.js format."""
1216
1174
  check_requirements("tensorflowjs")
1217
- import tensorflow as tf
1218
- import tensorflowjs as tfjs
1219
1175
 
1220
- LOGGER.info(f"\n{prefix} starting export with tensorflowjs {tfjs.__version__}...")
1221
1176
  f = str(self.file).replace(self.file.suffix, "_web_model") # js dir
1222
1177
  f_pb = str(self.file.with_suffix(".pb")) # *.pb path
1223
-
1224
- gd = tf.Graph().as_graph_def() # TF GraphDef
1225
- with open(f_pb, "rb") as file:
1226
- gd.ParseFromString(file.read())
1227
- outputs = ",".join(gd_outputs(gd))
1228
- LOGGER.info(f"\n{prefix} output node names: {outputs}")
1229
-
1230
- quantization = "--quantize_float16" if self.args.half else "--quantize_uint8" if self.args.int8 else ""
1231
- with spaces_in_path(f_pb) as fpb_, spaces_in_path(f) as f_: # exporter can not handle spaces in path
1232
- cmd = (
1233
- "tensorflowjs_converter "
1234
- f'--input_format=tf_frozen_model {quantization} --output_node_names={outputs} "{fpb_}" "{f_}"'
1235
- )
1236
- LOGGER.info(f"{prefix} running '{cmd}'")
1237
- subprocess.run(cmd, shell=True)
1238
-
1239
- if " " in f:
1240
- LOGGER.warning(f"{prefix} your model may not work correctly with spaces in path '{f}'.")
1241
-
1178
+ pb2tfjs(pb_file=f_pb, output_dir=f, half=self.args.half, int8=self.args.int8, prefix=prefix)
1242
1179
  # Add metadata
1243
1180
  YAML.save(Path(f) / "metadata.yaml", self.metadata) # add metadata.yaml
1244
1181
  return f
@@ -1510,17 +1447,16 @@ class NMSModel(torch.nn.Module):
1510
1447
  box, score, cls, extra = box[mask], score[mask], cls[mask], extra[mask]
1511
1448
  nmsbox = box.clone()
1512
1449
  # `8` is the minimum value experimented to get correct NMS results for obb
1513
- multiplier = 8 if self.obb else 1
1450
+ multiplier = (8 if self.obb else 1) / max(len(self.model.names), 1)
1514
1451
  # Normalize boxes for NMS since large values for class offset causes issue with int8 quantization
1515
1452
  if self.args.format == "tflite": # TFLite is already normalized
1516
1453
  nmsbox *= multiplier
1517
1454
  else:
1518
- nmsbox = multiplier * nmsbox / torch.tensor(x.shape[2:], **kwargs).max()
1519
- if not self.args.agnostic_nms: # class-specific NMS
1455
+ nmsbox = multiplier * (nmsbox / torch.tensor(x.shape[2:], **kwargs).max())
1456
+ if not self.args.agnostic_nms: # class-wise NMS
1520
1457
  end = 2 if self.obb else 4
1521
1458
  # fully explicit expansion otherwise reshape error
1522
- # large max_wh causes issues when quantizing
1523
- cls_offset = cls.reshape(-1, 1).expand(nmsbox.shape[0], end)
1459
+ cls_offset = cls.view(cls.shape[0], 1).expand(cls.shape[0], end)
1524
1460
  offbox = nmsbox[:, :end] + cls_offset * multiplier
1525
1461
  nmsbox = torch.cat((offbox, nmsbox[:, end:]), dim=-1)
1526
1462
  nms_fn = (
@@ -877,7 +877,7 @@ class Model(torch.nn.Module):
877
877
  >>> model = model._apply(lambda t: t.cuda()) # Move model to GPU
878
878
  """
879
879
  self._check_is_pytorch_model()
880
- self = super()._apply(fn) # noqa
880
+ self = super()._apply(fn)
881
881
  self.predictor = None # reset predictor as device may have changed
882
882
  self.overrides["device"] = self.device # was str(self.device) i.e. device(type='cuda', index=0) -> 'cuda:0'
883
883
  return self
@@ -727,7 +727,7 @@ class BaseTrainer:
727
727
 
728
728
  def label_loss_items(self, loss_items=None, prefix="train"):
729
729
  """
730
- Return a loss dict with labelled training loss items tensor.
730
+ Return a loss dict with labeled training loss items tensor.
731
731
 
732
732
  Note:
733
733
  This is not needed for classification but necessary for segmentation & detection
@@ -89,7 +89,7 @@ class RTDETRDataset(YOLODataset):
89
89
  transforms = v8_transforms(self, self.imgsz, hyp, stretch=True)
90
90
  else:
91
91
  # transforms = Compose([LetterBox(new_shape=(self.imgsz, self.imgsz), auto=False, scale_fill=True)])
92
- transforms = Compose([])
92
+ transforms = Compose([lambda x: {**x, **{"ratio_pad": [x["ratio_pad"], [0, 0]]}}])
93
93
  transforms.append(
94
94
  Format(
95
95
  bbox_format="xywh",
@@ -38,7 +38,7 @@ class ClassificationTrainer(BaseTrainer):
38
38
  preprocess_batch: Preprocess a batch of images and classes.
39
39
  progress_string: Return a formatted string showing training progress.
40
40
  get_validator: Return an instance of ClassificationValidator.
41
- label_loss_items: Return a loss dict with labelled training loss items.
41
+ label_loss_items: Return a loss dict with labeled training loss items.
42
42
  final_eval: Evaluate trained model and save validation results.
43
43
  plot_training_samples: Plot training samples with their annotations.
44
44
 
@@ -178,7 +178,7 @@ class ClassificationTrainer(BaseTrainer):
178
178
 
179
179
  def label_loss_items(self, loss_items: torch.Tensor | None = None, prefix: str = "train"):
180
180
  """
181
- Return a loss dict with labelled training loss items tensor.
181
+ Return a loss dict with labeled training loss items tensor.
182
182
 
183
183
  Args:
184
184
  loss_items (torch.Tensor, optional): Loss tensor items.
@@ -428,7 +428,7 @@ class AutoBackend(nn.Module):
428
428
  LOGGER.info(f"Loading {w} for TensorFlow GraphDef inference...")
429
429
  import tensorflow as tf
430
430
 
431
- from ultralytics.engine.exporter import gd_outputs
431
+ from ultralytics.utils.export.tensorflow import gd_outputs
432
432
 
433
433
  def wrap_frozen_graph(gd, inputs, outputs):
434
434
  """Wrap frozen graphs for deployment."""