dgenerate-ultralytics-headless 8.3.135__py3-none-any.whl → 8.3.138__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 (40) hide show
  1. {dgenerate_ultralytics_headless-8.3.135.dist-info → dgenerate_ultralytics_headless-8.3.138.dist-info}/METADATA +1 -2
  2. {dgenerate_ultralytics_headless-8.3.135.dist-info → dgenerate_ultralytics_headless-8.3.138.dist-info}/RECORD +40 -40
  3. tests/test_cuda.py +2 -7
  4. tests/test_exports.py +1 -6
  5. tests/test_solutions.py +181 -8
  6. ultralytics/__init__.py +1 -1
  7. ultralytics/cfg/__init__.py +4 -4
  8. ultralytics/data/base.py +1 -1
  9. ultralytics/data/build.py +4 -3
  10. ultralytics/data/loaders.py +2 -2
  11. ultralytics/engine/exporter.py +6 -7
  12. ultralytics/engine/model.py +2 -2
  13. ultralytics/engine/predictor.py +3 -10
  14. ultralytics/engine/trainer.py +1 -1
  15. ultralytics/engine/validator.py +1 -1
  16. ultralytics/hub/auth.py +2 -2
  17. ultralytics/hub/utils.py +8 -3
  18. ultralytics/models/yolo/classify/predict.py +11 -0
  19. ultralytics/models/yolo/obb/val.py +1 -1
  20. ultralytics/models/yolo/world/train.py +66 -20
  21. ultralytics/models/yolo/world/train_world.py +1 -0
  22. ultralytics/models/yolo/yoloe/train.py +10 -39
  23. ultralytics/models/yolo/yoloe/val.py +3 -3
  24. ultralytics/nn/tasks.py +41 -24
  25. ultralytics/nn/text_model.py +1 -0
  26. ultralytics/solutions/similarity_search.py +3 -6
  27. ultralytics/solutions/streamlit_inference.py +1 -1
  28. ultralytics/utils/__init__.py +1 -1
  29. ultralytics/utils/callbacks/hub.py +5 -4
  30. ultralytics/utils/checks.py +16 -13
  31. ultralytics/utils/downloads.py +7 -5
  32. ultralytics/utils/export.py +1 -1
  33. ultralytics/utils/metrics.py +51 -22
  34. ultralytics/utils/plotting.py +19 -13
  35. ultralytics/utils/torch_utils.py +3 -0
  36. ultralytics/utils/triton.py +1 -1
  37. {dgenerate_ultralytics_headless-8.3.135.dist-info → dgenerate_ultralytics_headless-8.3.138.dist-info}/WHEEL +0 -0
  38. {dgenerate_ultralytics_headless-8.3.135.dist-info → dgenerate_ultralytics_headless-8.3.138.dist-info}/entry_points.txt +0 -0
  39. {dgenerate_ultralytics_headless-8.3.135.dist-info → dgenerate_ultralytics_headless-8.3.138.dist-info}/licenses/LICENSE +0 -0
  40. {dgenerate_ultralytics_headless-8.3.135.dist-info → dgenerate_ultralytics_headless-8.3.138.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.135
3
+ Version: 8.3.138
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>
@@ -46,7 +46,6 @@ Requires-Dist: tqdm>=4.64.0
46
46
  Requires-Dist: psutil
47
47
  Requires-Dist: py-cpuinfo
48
48
  Requires-Dist: pandas>=1.1.4
49
- Requires-Dist: seaborn>=0.11.0
50
49
  Requires-Dist: ultralytics-thop>=2.0.0
51
50
  Provides-Extra: dev
52
51
  Requires-Dist: ipython; extra == "dev"
@@ -1,17 +1,17 @@
1
- dgenerate_ultralytics_headless-8.3.135.dist-info/licenses/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
1
+ dgenerate_ultralytics_headless-8.3.138.dist-info/licenses/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
2
2
  tests/__init__.py,sha256=xnMhv3O_DF1YrW4zk__ZywQzAaoTDjPKPoiI1Ktss1w,670
3
3
  tests/conftest.py,sha256=rsIAipRKfrVNoTaJ1LdpYue8AbcJ_fr3d3WIlM_6uXY,2982
4
4
  tests/test_cli.py,sha256=vXUC_EK0fa87JRhHsCOZf7AJQ5_Jm1sL8u-yhmsaQh0,5851
5
- tests/test_cuda.py,sha256=eKwaqLxWTRRYNROnkH24Ch-HmxTRKQLSIxbMYFYq_p0,8123
5
+ tests/test_cuda.py,sha256=L_2xp2TH-pInsdI8UrbZ5onRtHQGdUVoPXnyX6Ot4_U,7950
6
6
  tests/test_engine.py,sha256=aGqZ8P7QO5C_nOa1b4FOyk92Ysdk5WiP-ST310Vyxys,4962
7
- tests/test_exports.py,sha256=UeeBloqYYGZNh520R3CR80XBxA9XFrNmbK9An6V6C4w,9838
7
+ tests/test_exports.py,sha256=dhZn86LdbapW15RthQF870LGxDjC1MUZhlGdBgPmgIQ,9716
8
8
  tests/test_integrations.py,sha256=dQteeRsRVuT_p5-T88-7jqT65Zm9iAXkyKg-KQ1_TQ8,6341
9
9
  tests/test_python.py,sha256=KWsncKpeDdRmjRftmJpsMl7bBLI3TG_I7Lb4kuemZzQ,25618
10
- tests/test_solutions.py,sha256=IFlqyOUCvGbLe_YZqWmNCe_afg4as0p-SfAv3j7VURI,6205
11
- ultralytics/__init__.py,sha256=7IMXy8Z7sekeQRLOVZyuYbA-1kse0gieArFyUxQ9dyE,730
10
+ tests/test_solutions.py,sha256=4_Ce7VmsAoALN79a72nEpRgIJqx1oGnCY7yre9a-5vk,12671
11
+ ultralytics/__init__.py,sha256=dNL32IT6IwReXAZE3Gp8ZeYZDxmgnF_xLn60OR9wXzg,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=p1dKUDoVsnjJG8Qj5Q-eukb0WH2IoWV3BcJpEmKu2tE,39487
14
+ ultralytics/cfg/__init__.py,sha256=mpvLR68Iff4J59zYGhysSl8VwIVVzV_VMOYeVdqnYj4,39544
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
@@ -106,11 +106,11 @@ ultralytics/cfg/trackers/bytetrack.yaml,sha256=6u-tiZlk16EqEwkNXaMrza6PAQmWj_ypg
106
106
  ultralytics/data/__init__.py,sha256=nAXaL1puCc7z_NjzQNlJnhbVhT9Fla2u7Dsqo7q1dAc,644
107
107
  ultralytics/data/annotator.py,sha256=VEwb11FsEZm75qlEp8XDHFGKW0_rGsEaFDaBVd771Kw,2902
108
108
  ultralytics/data/augment.py,sha256=5O02Um483j7VAutLUz13IGpuuEdvyD9mhTMxFCFwCas,129342
109
- ultralytics/data/base.py,sha256=bsASjxdkvojkFjas-JfFNSpBjo0GRAbYKDh64Y2hCH4,19015
110
- ultralytics/data/build.py,sha256=Ez_HSx-ZpL3Z1C4mDnyGPi107saG3TLR4PC7iv2sz_4,9807
109
+ ultralytics/data/base.py,sha256=Yn0pRz1E_yIx2IJtQClA0FuWkYrlpJfuOGPlg3QUGiI,19020
110
+ ultralytics/data/build.py,sha256=J1aP7qYioSiP2xq3QefiRWk3-c7lKzhNCR0hqXLQFos,9850
111
111
  ultralytics/data/converter.py,sha256=znXH2XTdo0Q4NDHMny1ydVBvrxKn2kbbwI-X5bn1MlQ,26890
112
112
  ultralytics/data/dataset.py,sha256=uc5OMkaQtWQHBd_KST_WXO6FEoeF4xUhKDDJBKkQ354,34916
113
- ultralytics/data/loaders.py,sha256=Wn_93-niQZg57VuX-vXF9MmcdHrGs5RlevdyO_V5J0s,29951
113
+ ultralytics/data/loaders.py,sha256=ybkN2q9nFtjl-YQYCy_fvlTBuA19ARDSeoag2Gg7aTU,29961
114
114
  ultralytics/data/split.py,sha256=6UFXcbVrzYVAPmFbl4FeZFJOkdbN3jQFepJxi_pD-I0,4748
115
115
  ultralytics/data/split_dota.py,sha256=ihG56YfNFZJDq1r7Zcgk8fKzde3gn21W0f67ub6nT68,11879
116
116
  ultralytics/data/utils.py,sha256=5vD6Nea2SE14Ap9nFTHkJgzOgVKJy-P8-bcqqxa_UB0,35551
@@ -119,17 +119,17 @@ ultralytics/data/scripts/get_coco.sh,sha256=UuJpJeo3qQpTHVINeOpmP0NYmg8PhEFE3A8J
119
119
  ultralytics/data/scripts/get_coco128.sh,sha256=qmRQl_hOKrsdHrTrnyQuFIH01oDz3lfaz138OgGfLt8,650
120
120
  ultralytics/data/scripts/get_imagenet.sh,sha256=hr42H16bM47iT27rgS7MpEo-GeOZAYUQXgr0B2cwn48,1705
121
121
  ultralytics/engine/__init__.py,sha256=lm6MckFYCPTbqIoX7w0s_daxdjNeBeKW6DXppv1-QUM,70
122
- ultralytics/engine/exporter.py,sha256=tXqZlcOZnDqtK7A0nwago7FfDAb3ftnYui-VeOFzVs0,70823
123
- ultralytics/engine/model.py,sha256=fWhPNWUQzjjWfTEXzTaqSSearV4THRkEa_fl4dDvzWw,52930
124
- ultralytics/engine/predictor.py,sha256=AwKpOGY2G-thNNiRw4Kf_MBLamq5tbRhXLNSMRArqFo,21803
122
+ ultralytics/engine/exporter.py,sha256=tJTl6AkJ-OCgE1pstsu2iOSHqidkuqejPetNCg8S64k,70841
123
+ ultralytics/engine/model.py,sha256=BtC5KYNrdfhryrS7b6ZXDIsmtObEeIDTePCv1gO4br4,52952
124
+ ultralytics/engine/predictor.py,sha256=rZ5mIPeejkxUerpTfUf_1rSAklOR3THqoejlil4C04w,21651
125
125
  ultralytics/engine/results.py,sha256=MhbyMCwgslmtV53fqii4UJUaLQ4gKTKdkXi7vvmJDAE,79628
126
- ultralytics/engine/trainer.py,sha256=c_iGyt6bwIf4aRUeVcVEuOKG9ZpixJsZUbI2eMqQXto,38951
126
+ ultralytics/engine/trainer.py,sha256=xdgNAgq6umJ6915tiCK3U22NeY7w1HnvmAhXlwS_hYI,38955
127
127
  ultralytics/engine/tuner.py,sha256=zEW1UpLlZ6N4xbvS7MxICkshRlaFgLNfuADA0VfRpao,12629
128
- ultralytics/engine/validator.py,sha256=jfV81wuFDgrVVXEcPzgOpxAPrAZn-1LgpKwu9l_1-ts,17050
128
+ ultralytics/engine/validator.py,sha256=f9UUv3QqQStLrO1nojrHkdS58qYQxKXaoIQQria6WyA,17054
129
129
  ultralytics/hub/__init__.py,sha256=wDtAUKdfqob95tfFHgDJFXcsNSDSdoIQkJTm-CfIUTI,6616
130
- ultralytics/hub/auth.py,sha256=_bGQVLTgP-ina4fQxq2M7qkj9zKKfxb99_VWgN3S_4k,5549
130
+ ultralytics/hub/auth.py,sha256=cykVsFR5xjqZdf8_TagHceGc1BzrfkiSHrzQdoa0nOQ,5555
131
131
  ultralytics/hub/session.py,sha256=Hohzn2L2QJTYszIHqwxnsK4V-0MOU-8ldMIfpxMtLSE,18708
132
- ultralytics/hub/utils.py,sha256=luSqI4Ym7A1NRFrDsryPTDrlFL8FJdWQ9Zyrl9d-Abs,9661
132
+ ultralytics/hub/utils.py,sha256=Hh_ND38R7ssflXh9ndG739-8283oej_EZzlOftIDFEU,9936
133
133
  ultralytics/hub/google/__init__.py,sha256=rV9_KoRBwYlwyx3QLaBp1opw5Sjrbgl0YoDHtXoHIMw,8429
134
134
  ultralytics/models/__init__.py,sha256=DqQFFYJ4IQlqIDb61H1HzcnZU7SuHN-43bw94-l-YAQ,309
135
135
  ultralytics/models/fastsam/__init__.py,sha256=HGJ8EKlBAsdF-e2aIwQLjSDAFI_r0yHR0A1gzrp4vqE,231
@@ -166,7 +166,7 @@ ultralytics/models/utils/ops.py,sha256=SuBnwwgUTqByNHpufobGLW72yO2cyfZFi14KAFWSj
166
166
  ultralytics/models/yolo/__init__.py,sha256=or0j5xvcM0usMlsFTYhNAOcQUri7reD0cD9JR5b7zDk,307
167
167
  ultralytics/models/yolo/model.py,sha256=oGPLPkgym0kfFhkLgyriR5KbKTQyJH-1Uggup5wFgw0,14296
168
168
  ultralytics/models/yolo/classify/__init__.py,sha256=9--HVaNOfI1K7rn_rRqclL8FUAnpfeBrRqEQIaQw2xM,383
169
- ultralytics/models/yolo/classify/predict.py,sha256=JV9szginTQ9Lpob0FozhKMiEIu1vVaYg4YItuVK2AFM,4081
169
+ ultralytics/models/yolo/classify/predict.py,sha256=QckEv4qNiCSjIbHFxq9KVKpYHL4TbuLWfT5zXoMQEpU,4576
170
170
  ultralytics/models/yolo/classify/train.py,sha256=rv2CJv9fzvtHf2q4l5g0RsjplWKeLpz637kKqjtrLNY,9737
171
171
  ultralytics/models/yolo/classify/val.py,sha256=xk-YwSQdl_oqyCBV0OOAOcXFL6CchebFOc36AkRSyjE,9992
172
172
  ultralytics/models/yolo/detect/__init__.py,sha256=GIRsLYR-kT4JJx7lh4ZZAFGBZj0aebokuU0A7JbjDVA,257
@@ -176,7 +176,7 @@ ultralytics/models/yolo/detect/val.py,sha256=7AB_wZi7aQ9_V1pZQSWk5qiJYS34fuO3P5a
176
176
  ultralytics/models/yolo/obb/__init__.py,sha256=tQmpG8wVHsajWkZdmD6cjGohJ4ki64iSXQT8JY_dydo,221
177
177
  ultralytics/models/yolo/obb/predict.py,sha256=L40iamQgTY7VDn0WggG2jeJK8cVUo1qsNuFSbK67ry0,2974
178
178
  ultralytics/models/yolo/obb/train.py,sha256=NBSpXCyIn2qxtaG7gvolUzXOB0mf3oEFIpQZHTES1_s,3458
179
- ultralytics/models/yolo/obb/val.py,sha256=dkXUh2JfffILVRkfXycQGImQQssUDgKMtfDRP7jUpV0,13981
179
+ ultralytics/models/yolo/obb/val.py,sha256=Qzer8to_DhPmJ56BNDZh6d9f4o5TY-OgebZpzY8lUxY,13984
180
180
  ultralytics/models/yolo/pose/__init__.py,sha256=63xmuHZLNzV8I76HhVXAq4f2W0KTk8Oi9eL-Y204LyQ,227
181
181
  ultralytics/models/yolo/pose/predict.py,sha256=sY-yMVl-hW8tGVSKt-5Pl1Bhdhj9exnmGIeb4n9wUDc,3836
182
182
  ultralytics/models/yolo/pose/train.py,sha256=dKa1Vzt4GoZ9yqdK6olqLEg-qhYaPUh29Qg62bHAVi8,6502
@@ -186,17 +186,17 @@ ultralytics/models/yolo/segment/predict.py,sha256=mIC3aHI7Jg4dU1k2UZnjVj4unE-5TW
186
186
  ultralytics/models/yolo/segment/train.py,sha256=EIyIAjYp127Mb-DomyjPORaONu57OY_gOTK9p2MwW6E,5359
187
187
  ultralytics/models/yolo/segment/val.py,sha256=cXJM1JNuzDraU0SJQRIdzNxabd0bfcxiRE8wozHZChY,18415
188
188
  ultralytics/models/yolo/world/__init__.py,sha256=nlh8I6t8hMGz_vZg8QSlsUW1R-2eKvn9CGUoPPQEGhA,131
189
- ultralytics/models/yolo/world/train.py,sha256=HUJ0XiJIGx_FA9kqNYnSFsaKWMiZUDxgkpfGoBH6UNc,4896
190
- ultralytics/models/yolo/world/train_world.py,sha256=DSa-t9jDbtwF43SJlvtESh1Ux7M77zo9f945eR2D-5w,8363
189
+ ultralytics/models/yolo/world/train.py,sha256=2R0h36kggT8ZBpwaACqgg9vd34rNU-tbPsfPuxuBV4g,6901
190
+ ultralytics/models/yolo/world/train_world.py,sha256=fFhhI-toaEy1_-XcPM1_mF395WRQ26gZ4UxqyUAZmWw,8461
191
191
  ultralytics/models/yolo/yoloe/__init__.py,sha256=6SLytdJtwu37qewf7CobG7C7Wl1m-xtNdvCXEasfPDE,760
192
192
  ultralytics/models/yolo/yoloe/predict.py,sha256=N0oYcr_mdw8wyUAWprAwJhrA0r23BaTeYXEjw2e8_mI,6993
193
- ultralytics/models/yolo/yoloe/train.py,sha256=St3zw_XWRol9pODWU4lvKlJnWYr1lmWQNuhLFwWMge4,12989
193
+ ultralytics/models/yolo/yoloe/train.py,sha256=xRPDJ3nUWxtqjESfmUtsZslVhpgzrZRw8z_QU5hV6nc,11710
194
194
  ultralytics/models/yolo/yoloe/train_seg.py,sha256=BYFBd04k5WQaJPcFbCvVIbEf2IOQyW8_sGeoVT_74j0,4632
195
- ultralytics/models/yolo/yoloe/val.py,sha256=oA8cVT3pBXF6aPZy7ITq0mDcktRuIgks8tTtqMRISyY,8431
195
+ ultralytics/models/yolo/yoloe/val.py,sha256=g6GK5NgVEV9bhXzo1zes0NGa4JEZS3UB-5sPN8fGyZw,8440
196
196
  ultralytics/nn/__init__.py,sha256=rjociYD9lo_K-d-1s6TbdWklPLjTcEHk7OIlRDJstIE,615
197
197
  ultralytics/nn/autobackend.py,sha256=X2cxCytBu9fmniy8uJ5aZb28IukQ-uxV1INXeS1lclA,39368
198
- ultralytics/nn/tasks.py,sha256=o7QZvlZyvmECxkITJjtDCPf-hAxXcZOLXP7PKtegOPQ,63594
199
- ultralytics/nn/text_model.py,sha256=8_7SRejKZA4Pi-ha0gjcWrQDDCDMBhtwlg8pPMWgjDE,13145
198
+ ultralytics/nn/tasks.py,sha256=iJWpwRr4yZg1dTT-9jXuzIqkdFmbZm1b7hejnO-CiZk,64337
199
+ ultralytics/nn/text_model.py,sha256=wr5yPRbMqtSr2N5Rzdd0vuv9PcQe8qw4uO596ZHZVGU,13236
200
200
  ultralytics/nn/modules/__init__.py,sha256=dXLtIk9rt944WfsTdpgEdWOg3HQEHdwQztuZ6WNJygs,3144
201
201
  ultralytics/nn/modules/activation.py,sha256=PvXZkA9AzEntR575JkFORdmtcRwATyy0lje-uHA5_8w,2210
202
202
  ultralytics/nn/modules/block.py,sha256=yd6Ao9T2UJNAWc8oB1-CSxyF6-exqbFcN3hTWUZNU3M,66701
@@ -218,10 +218,10 @@ ultralytics/solutions/parking_management.py,sha256=BV-2lpSfgmK7fib3DnPSZ5rtLdy11
218
218
  ultralytics/solutions/queue_management.py,sha256=p1-cuI_rs4ygtlBryXjE65NYG2bnZXhp3ylggFnWcRs,4344
219
219
  ultralytics/solutions/region_counter.py,sha256=Zn35YRXNzhBk27D9MLOHBYe2L1o6H2ey3mEwCXofB_E,5418
220
220
  ultralytics/solutions/security_alarm.py,sha256=JdkQUjqJl3iCd2MLVYkh1L7askvhi3_gp0RLXG6s390,6247
221
- ultralytics/solutions/similarity_search.py,sha256=WTYmHNHfFrRiJ6mrZhJvGPsjt3szQUiM6VRpw2eBRjA,7332
221
+ ultralytics/solutions/similarity_search.py,sha256=NVjrlxWStXPhSaE_tGW0g1_j8vD0evaT9IjGOHYERFg,7323
222
222
  ultralytics/solutions/solutions.py,sha256=1iZIj3Z5bs14WbVT8MIDXABfW-pBmfvQNdBJ6l21uVY,32696
223
223
  ultralytics/solutions/speed_estimation.py,sha256=r7S5nGIx8PTV-zC4zCI36lQD2DVy5cen5cTXItfQIHo,5318
224
- ultralytics/solutions/streamlit_inference.py,sha256=M0ppTFInqSPrdytZBLH8x-XoA7zFc7PaRQ51wHG9ppU,9846
224
+ ultralytics/solutions/streamlit_inference.py,sha256=p1bBKTtmvB6zStXdOzS0CGYurm4zu82WKii5rJriizA,9849
225
225
  ultralytics/solutions/trackzone.py,sha256=mfklnZcVRqI3bbhPiHF2iSoV6INcd10wwwGP4tlK7L0,3854
226
226
  ultralytics/solutions/vision_eye.py,sha256=LCb-2YPVvEks9e7xqZtNGftpAXNaZhEUb5yb3N0ni_U,2952
227
227
  ultralytics/solutions/templates/similarity-search.html,sha256=DPoAO-1H-KXNt_T8mGtSCsYUEi_5Nrx01p0cZfX-E8Q,3790
@@ -234,39 +234,39 @@ ultralytics/trackers/utils/__init__.py,sha256=lm6MckFYCPTbqIoX7w0s_daxdjNeBeKW6D
234
234
  ultralytics/trackers/utils/gmc.py,sha256=843LlmqWuXdUULBNpxVCZlil-_2QG-UwvscUCFbpGjA,14541
235
235
  ultralytics/trackers/utils/kalman_filter.py,sha256=A0CqOnnaKH6kr0XwuHzyHmIU6aJAjJYxF9jVlNBKZHo,21326
236
236
  ultralytics/trackers/utils/matching.py,sha256=7eIufSdeN7cXuFMjvcfvz0Ldq84m4YKZl5IGxBR8IIo,7169
237
- ultralytics/utils/__init__.py,sha256=vac0M-Hx55QXl6Vod3QPjnLBlt87Hwxu1784RXPmeQA,52879
237
+ ultralytics/utils/__init__.py,sha256=9RF8KyUHd_YyovvZzlcnZzxx-jkxBLrxfXfkFVj64Iw,52882
238
238
  ultralytics/utils/autobatch.py,sha256=kg05q2qKg74y_Uq2vvr01i3KhLfpVR7sT0IXBt3_kyI,4921
239
239
  ultralytics/utils/autodevice.py,sha256=OKZfTbswg6SlsYGCGMqROkA-451CXGG47oeyC5Q1kFM,7232
240
240
  ultralytics/utils/benchmarks.py,sha256=lDNNnLeLUzmqKrqrqlCOiau-q7A-gcLooZP2dbxCu-U,30214
241
- ultralytics/utils/checks.py,sha256=L5G8CiQo8v2842KLGOaLG5y_AYRoa5gxCdtTt48LnS0,33129
241
+ ultralytics/utils/checks.py,sha256=GJbfMl608ihHSjN78Xjjky10Cglv-CYsxJ7Ra7HeH1U,33204
242
242
  ultralytics/utils/dist.py,sha256=aytW0JEkcA5ZTZucV92ot7Bn-apiej8aLk3QNWicjAc,4103
243
- ultralytics/utils/downloads.py,sha256=Rn8xDwn2bzgBqiYz3Xn0rm3MWjk4T-QUd2Ajlu1EpQ4,22312
243
+ ultralytics/utils/downloads.py,sha256=G1nd7c7Gwjf58nZzDVpXDtoFtzhZYbjKBnwbZVMWRG0,22333
244
244
  ultralytics/utils/errors.py,sha256=vY9h2evFSrHnZdHJVVrmm8Zzw4qVDLyo9DeYW5g0dFk,1573
245
- ultralytics/utils/export.py,sha256=XInnl9AQeik7EuR1492nzDvgDqaV43FlnM5CLamrgd4,8814
245
+ ultralytics/utils/export.py,sha256=Rr5R3GdJBapJJt1XHkH6VQwYN52-L_7wGiRDCgnb7BY,8817
246
246
  ultralytics/utils/files.py,sha256=0K4O1cgqRiXaDw7EQK13TqA5SME_RrvfDVQSPetNr5w,8042
247
247
  ultralytics/utils/instance.py,sha256=UOEsXR9V-bXNRk6BTonASBEgeMqvzzAk4S7VdXZJUAM,18090
248
248
  ultralytics/utils/loss.py,sha256=Woc_rj7ptCyezHdylEygXMeSEgivYu_B9jJHD4UwxWE,37607
249
- ultralytics/utils/metrics.py,sha256=pWNq-66VqkMjj05Gqkm8ddoElDK72q_U9cl8y-aEN6k,53963
249
+ ultralytics/utils/metrics.py,sha256=n8guPEADBMRNpeXNShEX-fxVv9xck8S4QaOIiaW_kl0,56037
250
250
  ultralytics/utils/ops.py,sha256=YFwPrKlPcgEmgAWqnJVR0Ccx5NQgp5e3P-YYHwVSP0k,34779
251
251
  ultralytics/utils/patches.py,sha256=_dhIU_eDklQE-aWIjpyjPHl_wOwZoGuIUQnXgdSwk_A,5020
252
- ultralytics/utils/plotting.py,sha256=m9Hsbt6U073jAiztX6clpd9KzznW62oHxCWlBcm0T-s,46920
252
+ ultralytics/utils/plotting.py,sha256=oFq19c3tRng-dKHEH-j-S_wLG4CZ_mk8wqE_Gab2H8A,47221
253
253
  ultralytics/utils/tal.py,sha256=P5nPoR9qNnFuDIda0fsn8WP6m1V8r7EbvXUuhNRFFTA,20805
254
- ultralytics/utils/torch_utils.py,sha256=2SJxxg8Qr0YqOoQ-8qAYn6VrzZdQMObqiw3CJZ-rAY0,39611
255
- ultralytics/utils/triton.py,sha256=xK9Db_ZUVDnIK1u76S2G-6ulIBsLfj9HN_YOaSrnMuU,5304
254
+ ultralytics/utils/torch_utils.py,sha256=xQgznbCdnuEkCajUpx5q8SfUM8wh9Bb-PcHOMl2g1KI,39670
255
+ ultralytics/utils/triton.py,sha256=9P2rlQcGCTMFVKLA5S5mTYzU9cKbR5HF9ruVkPpVBE8,5307
256
256
  ultralytics/utils/tuner.py,sha256=0Bp7l5dWZe1RzdvAIa11wQoX6eoAaoNRcA-EAnpofbk,6755
257
257
  ultralytics/utils/callbacks/__init__.py,sha256=hzL63Rce6VkZhP4Lcim9LKjadixaQG86nKqPhk7IkS0,242
258
258
  ultralytics/utils/callbacks/base.py,sha256=p8YCeYDp4GLcyHWFZxC2Wxr2IXLw_MfIE5ef1fOQcWk,6848
259
259
  ultralytics/utils/callbacks/clearml.py,sha256=z-MmCALz1FcNSec8CmDiFHkRd_zTzzuPDCidq_xkUXY,5990
260
260
  ultralytics/utils/callbacks/comet.py,sha256=_j8tKKxGlxDcw_Rx4Ow2PjZ3UpBHm9gLJlYSVU0WJ_E,22221
261
261
  ultralytics/utils/callbacks/dvc.py,sha256=NywyiMqJfnK_UfJ_f1IK31puyIXZy0iVJQ4bB9uyu08,7532
262
- ultralytics/utils/callbacks/hub.py,sha256=dPSeSStRE1x-WYyqrUghCp_VtBxNZ5-Bmb4wW2KYV2Y,4073
262
+ ultralytics/utils/callbacks/hub.py,sha256=1RmGiCaog1GoTya9OAyGELbQ2Lk5X3EWh7RYMxns0so,4177
263
263
  ultralytics/utils/callbacks/mlflow.py,sha256=rcjjN_QVg6XoL4Kbw8YqC28RDCQMs0LxfsXRpAc8BgY,5430
264
264
  ultralytics/utils/callbacks/neptune.py,sha256=yYUgEgSv6L39sSev6vjwhAWU3DlPDsbSDVFoR24NYio,4664
265
265
  ultralytics/utils/callbacks/raytune.py,sha256=A8amUGpux7dYES-L1iSeMoMXBySGWCD1aUqT7vcG-pU,1284
266
266
  ultralytics/utils/callbacks/tensorboard.py,sha256=jgYnym3cUQFAgN1GzTyO7l3jINtfAh8zhrllDvnLuVQ,5339
267
267
  ultralytics/utils/callbacks/wb.py,sha256=iDRFXI4IIDm8R5OI89DMTmjs8aHLo1HRCLkOFKdaMG4,7507
268
- dgenerate_ultralytics_headless-8.3.135.dist-info/METADATA,sha256=8_HSDModHJ24S-bmagyx903_49yFcEJGC63r5nON6g4,38327
269
- dgenerate_ultralytics_headless-8.3.135.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
270
- dgenerate_ultralytics_headless-8.3.135.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
271
- dgenerate_ultralytics_headless-8.3.135.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
272
- dgenerate_ultralytics_headless-8.3.135.dist-info/RECORD,,
268
+ dgenerate_ultralytics_headless-8.3.138.dist-info/METADATA,sha256=nEE7PWdXEk2qcDj95YSk9gnmx_YRfC-qzikx69OBVYY,38296
269
+ dgenerate_ultralytics_headless-8.3.138.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
270
+ dgenerate_ultralytics_headless-8.3.138.dist-info/entry_points.txt,sha256=YM_wiKyTe9yRrsEfqvYolNO5ngwfoL4-NwgKzc8_7sI,93
271
+ dgenerate_ultralytics_headless-8.3.138.dist-info/top_level.txt,sha256=XP49TwiMw4QGsvTLSYiJhz1xF_k7ev5mQ8jJXaXi45Q,12
272
+ dgenerate_ultralytics_headless-8.3.138.dist-info/RECORD,,
tests/test_cuda.py CHANGED
@@ -41,7 +41,7 @@ def test_amp():
41
41
 
42
42
 
43
43
  @pytest.mark.slow
44
- # @pytest.mark.skipif(IS_JETSON, reason="Temporary disable ONNX for Jetson")
44
+ @pytest.mark.skipif(IS_JETSON, reason="Temporary disable ONNX for Jetson")
45
45
  @pytest.mark.skipif(not DEVICES, reason="No CUDA devices available")
46
46
  @pytest.mark.parametrize(
47
47
  "task, dynamic, int8, half, batch, simplify, nms",
@@ -50,12 +50,7 @@ def test_amp():
50
50
  for task, dynamic, int8, half, batch, simplify, nms in product(
51
51
  TASKS, [True, False], [False], [False], [1, 2], [True, False], [True, False]
52
52
  )
53
- if not (
54
- (int8 and half)
55
- or (task == "classify" and nms)
56
- or (task == "obb" and nms and (not TORCH_1_13 or IS_JETSON)) # obb nms fails on NVIDIA Jetson
57
- or (simplify and dynamic) # onnxslim is slow when dynamic=True
58
- )
53
+ if not ((int8 and half) or (task == "classify" and nms) or (task == "obb" and nms and not TORCH_1_13))
59
54
  ],
60
55
  )
61
56
  def test_export_onnx_matrix(task, dynamic, int8, half, batch, simplify, nms):
tests/test_exports.py CHANGED
@@ -83,12 +83,7 @@ def test_export_openvino_matrix(task, dynamic, int8, half, batch, nms):
83
83
  for task, dynamic, int8, half, batch, simplify, nms in product(
84
84
  TASKS, [True, False], [False], [False], [1, 2], [True, False], [True, False]
85
85
  )
86
- if not (
87
- (int8 and half)
88
- or (task == "classify" and nms)
89
- or (task == "obb" and nms and not TORCH_1_13)
90
- or (simplify and dynamic) # onnxslim is slow when dynamic=True
91
- )
86
+ if not ((int8 and half) or (task == "classify" and nms) or (task == "obb" and nms and not TORCH_1_13))
92
87
  ],
93
88
  )
94
89
  def test_export_onnx_matrix(task, dynamic, int8, half, batch, simplify, nms):
tests/test_solutions.py CHANGED
@@ -3,7 +3,11 @@
3
3
  # Tests Ultralytics Solutions: https://docs.ultralytics.com/solutions/,
4
4
  # including every solution excluding DistanceCalculation and Security Alarm System.
5
5
 
6
+ import os
7
+ from unittest.mock import patch
8
+
6
9
  import cv2
10
+ import numpy as np
7
11
  import pytest
8
12
 
9
13
  from tests import MODEL, TMP
@@ -19,7 +23,10 @@ POSE_VIDEO = "solution_ci_pose_demo.mp4" # only for workouts monitoring solutio
19
23
  PARKING_VIDEO = "solution_ci_parking_demo.mp4" # only for parking management solution
20
24
  PARKING_AREAS_JSON = "solution_ci_parking_areas.json" # only for parking management solution
21
25
  PARKING_MODEL = "solutions_ci_parking_model.pt" # only for parking management solution
26
+ VERTICAL_VIDEO = "solution_vertical_demo.mp4" # only for vertical line counting
22
27
  REGION = [(10, 200), (540, 200), (540, 180), (10, 180)] # for object counting, speed estimation and queue management
28
+ HORIZONTAL_LINE = [(10, 200), (540, 200)] # for object counting
29
+ VERTICAL_LINE = [(320, 0), (320, 400)] # for object counting
23
30
 
24
31
  # Test configs for each solution : (name, class, needs_frame_count, video, kwargs)
25
32
  SOLUTIONS = [
@@ -30,6 +37,27 @@ SOLUTIONS = [
30
37
  DEMO_VIDEO,
31
38
  {"region": REGION, "model": MODEL, "show": SHOW},
32
39
  ),
40
+ (
41
+ "ObjectCounter",
42
+ solutions.ObjectCounter,
43
+ False,
44
+ DEMO_VIDEO,
45
+ {"region": HORIZONTAL_LINE, "model": MODEL, "show": SHOW},
46
+ ),
47
+ (
48
+ "ObjectCounterVertical",
49
+ solutions.ObjectCounter,
50
+ False,
51
+ DEMO_VIDEO,
52
+ {"region": VERTICAL_LINE, "model": MODEL, "show": SHOW},
53
+ ),
54
+ (
55
+ "ObjectCounterwithOBB",
56
+ solutions.ObjectCounter,
57
+ False,
58
+ DEMO_VIDEO,
59
+ {"region": REGION, "model": "yolo11n-obb.pt", "show": SHOW},
60
+ ),
33
61
  (
34
62
  "Heatmap",
35
63
  solutions.Heatmap,
@@ -63,28 +91,28 @@ SOLUTIONS = [
63
91
  solutions.Analytics,
64
92
  True,
65
93
  DEMO_VIDEO,
66
- {"analytics_type": "line", "model": MODEL, "show": SHOW},
94
+ {"analytics_type": "line", "model": MODEL, "show": SHOW, "figsize": (6.4, 3.2)},
67
95
  ),
68
96
  (
69
97
  "PieAnalytics",
70
98
  solutions.Analytics,
71
99
  True,
72
100
  DEMO_VIDEO,
73
- {"analytics_type": "pie", "model": MODEL, "show": SHOW},
101
+ {"analytics_type": "pie", "model": MODEL, "show": SHOW, "figsize": (6.4, 3.2)},
74
102
  ),
75
103
  (
76
104
  "BarAnalytics",
77
105
  solutions.Analytics,
78
106
  True,
79
107
  DEMO_VIDEO,
80
- {"analytics_type": "bar", "model": MODEL, "show": SHOW},
108
+ {"analytics_type": "bar", "model": MODEL, "show": SHOW, "figsize": (6.4, 3.2)},
81
109
  ),
82
110
  (
83
111
  "AreaAnalytics",
84
112
  solutions.Analytics,
85
113
  True,
86
114
  DEMO_VIDEO,
87
- {"analytics_type": "area", "model": MODEL, "show": SHOW},
115
+ {"analytics_type": "area", "model": MODEL, "show": SHOW, "figsize": (6.4, 3.2)},
88
116
  ),
89
117
  ("TrackZone", solutions.TrackZone, False, DEMO_VIDEO, {"region": REGION, "model": MODEL, "show": SHOW}),
90
118
  (
@@ -99,7 +127,7 @@ SOLUTIONS = [
99
127
  solutions.ObjectBlurrer,
100
128
  False,
101
129
  DEMO_VIDEO,
102
- {"blur_ratio": 0.5, "model": MODEL, "show": SHOW},
130
+ {"blur_ratio": 0.02, "model": MODEL, "show": SHOW},
103
131
  ),
104
132
  (
105
133
  "InstanceSegmentation",
@@ -160,7 +188,10 @@ def process_video(solution, video_path, needs_frame_count=False):
160
188
  def test_solution(name, solution_class, needs_frame_count, video, kwargs):
161
189
  """Test individual Ultralytics solution."""
162
190
  if video:
163
- safe_download(url=f"{ASSETS_URL}/{video}", dir=TMP)
191
+ if name != "ObjectCounterVertical":
192
+ safe_download(url=f"{ASSETS_URL}/{video}", dir=TMP)
193
+ else:
194
+ safe_download(url=f"{ASSETS_URL}/{VERTICAL_VIDEO}", dir=TMP)
164
195
  if name == "ParkingManager":
165
196
  safe_download(url=f"{ASSETS_URL}/{PARKING_AREAS_JSON}", dir=TMP)
166
197
  safe_download(url=f"{ASSETS_URL}/{PARKING_MODEL}", dir=TMP)
@@ -169,6 +200,7 @@ def test_solution(name, solution_class, needs_frame_count, video, kwargs):
169
200
  solution_class(**kwargs).inference() # requires interactive GUI environment
170
201
  return
171
202
 
203
+ video = VERTICAL_VIDEO if name == "ObjectCounterVertical" else video
172
204
  process_video(
173
205
  solution=solution_class(**kwargs),
174
206
  video_path=str(TMP / video),
@@ -181,7 +213,148 @@ def test_solution(name, solution_class, needs_frame_count, video, kwargs):
181
213
  @pytest.mark.skipif(IS_RASPBERRYPI, reason="Disabled due to slow performance on Raspberry Pi.")
182
214
  def test_similarity_search():
183
215
  """Test similarity search solution."""
184
- from ultralytics import solutions
185
-
186
216
  searcher = solutions.VisualAISearch()
187
217
  _ = searcher("a dog sitting on a bench") # Returns the results in format "- img name | similarity score"
218
+
219
+
220
+ def test_left_click_selection():
221
+ """Test distance calculation left click."""
222
+ dc = solutions.DistanceCalculation()
223
+ dc.boxes, dc.track_ids = [[10, 10, 50, 50]], [1]
224
+ dc.mouse_event_for_distance(cv2.EVENT_LBUTTONDOWN, 30, 30, None, None)
225
+ assert 1 in dc.selected_boxes
226
+
227
+
228
+ def test_right_click_reset():
229
+ """Test distance calculation right click."""
230
+ dc = solutions.DistanceCalculation()
231
+ dc.selected_boxes, dc.left_mouse_count = {1: [10, 10, 50, 50]}, 1
232
+ dc.mouse_event_for_distance(cv2.EVENT_RBUTTONDOWN, 0, 0, None, None)
233
+ assert dc.selected_boxes == {}
234
+ assert dc.left_mouse_count == 0
235
+
236
+
237
+ def test_parking_json_none():
238
+ """Test that ParkingManagement skips or errors cleanly when no JSON is provided."""
239
+ im0 = np.zeros((640, 480, 3), dtype=np.uint8)
240
+ try:
241
+ parkingmanager = solutions.ParkingManagement(json_path=None)
242
+ parkingmanager(im0)
243
+ except ValueError:
244
+ pytest.skip("Skipping test due to missing JSON.")
245
+
246
+
247
+ def test_analytics_graph_not_supported():
248
+ """Test that unsupported analytics type raises ModuleNotFoundError."""
249
+ try:
250
+ analytics = solutions.Analytics(analytics_type="test") # 'test' is unsupported
251
+ analytics.process(im0=None, frame_number=0)
252
+ assert False, "Expected ModuleNotFoundError for unsupported chart type"
253
+ except ModuleNotFoundError as e:
254
+ assert "test chart is not supported" in str(e)
255
+
256
+
257
+ def test_area_chart_padding():
258
+ """Test area chart graph update with dynamic class padding logic."""
259
+ analytics = solutions.Analytics(analytics_type="area")
260
+ analytics.update_graph(frame_number=1, count_dict={"car": 2}, plot="area")
261
+ plot_im = analytics.update_graph(frame_number=2, count_dict={"car": 3, "person": 1}, plot="area")
262
+ assert plot_im is not None
263
+
264
+
265
+ def test_config_update_method_with_invalid_argument():
266
+ """Test that update() raises ValueError for invalid config keys."""
267
+ obj = solutions.config.SolutionConfig()
268
+ try:
269
+ obj.update(invalid_key=123)
270
+ assert False, "Expected ValueError for invalid update argument"
271
+ except ValueError as e:
272
+ assert "❌ invalid_key is not a valid solution argument" in str(e)
273
+
274
+
275
+ def test_plot_with_no_masks():
276
+ """Test that instance segmentation handles cases with no masks."""
277
+ im0 = np.zeros((640, 480, 3), dtype=np.uint8)
278
+ isegment = solutions.InstanceSegmentation(model="yolo11n-seg.pt")
279
+ results = isegment(im0)
280
+ assert results.plot_im is not None
281
+
282
+
283
+ def test_streamlit_handle_video_upload_creates_file():
284
+ """Test Streamlit video upload logic saves file correctly."""
285
+ import io
286
+
287
+ fake_file = io.BytesIO(b"fake video content")
288
+ fake_file.read = fake_file.getvalue
289
+ if fake_file is not None:
290
+ g = io.BytesIO(fake_file.read())
291
+ with open("ultralytics.mp4", "wb") as out:
292
+ out.write(g.read())
293
+ output_path = "ultralytics.mp4"
294
+ else:
295
+ output_path = None
296
+ assert output_path == "ultralytics.mp4"
297
+ assert os.path.exists("ultralytics.mp4")
298
+ with open("ultralytics.mp4", "rb") as f:
299
+ assert f.read() == b"fake video content"
300
+ os.remove("ultralytics.mp4")
301
+
302
+
303
+ def test_similarity_search_app_init():
304
+ """Test SearchApp initializes with required attributes."""
305
+ app = solutions.SearchApp(device="cpu")
306
+ assert hasattr(app, "searcher")
307
+ assert hasattr(app, "run")
308
+
309
+
310
+ def test_similarity_search_complete(tmp_path):
311
+ """Test VisualAISearch end-to-end with sample image and query."""
312
+ from PIL import Image
313
+
314
+ image_dir = tmp_path / "images"
315
+ os.makedirs(image_dir, exist_ok=True)
316
+ for i in range(2):
317
+ img = Image.fromarray(np.uint8(np.random.rand(224, 224, 3) * 255))
318
+ img.save(image_dir / f"test_image_{i}.jpg")
319
+ searcher = solutions.VisualAISearch(data=str(image_dir))
320
+ results = searcher("a red and white object")
321
+ assert results
322
+
323
+
324
+ def test_distance_calculation_process_method():
325
+ """Test DistanceCalculation.process() computes distance between selected boxes."""
326
+ from ultralytics.solutions.solutions import SolutionResults
327
+
328
+ dc = solutions.DistanceCalculation()
329
+ dc.boxes, dc.track_ids, dc.clss, dc.confs = (
330
+ [[100, 100, 200, 200], [300, 300, 400, 400]],
331
+ [1, 2],
332
+ [0, 0],
333
+ [0.9, 0.95],
334
+ )
335
+ dc.selected_boxes = {1: dc.boxes[0], 2: dc.boxes[1]}
336
+ frame = np.zeros((480, 640, 3), dtype=np.uint8)
337
+ with patch.object(dc, "extract_tracks"), patch.object(dc, "display_output"), patch("cv2.setMouseCallback"):
338
+ result = dc.process(frame)
339
+ assert isinstance(result, SolutionResults)
340
+ assert result.total_tracks == 2
341
+ assert result.pixels_distance > 0
342
+
343
+
344
+ def test_object_crop_with_show_True():
345
+ """Test ObjectCropper init with show=True to cover display warning."""
346
+ solutions.ObjectCropper(show=True)
347
+
348
+
349
+ def test_display_output_method():
350
+ """Test that display_output triggers imshow, waitKey, and destroyAllWindows when enabled."""
351
+ counter = solutions.ObjectCounter(show=True)
352
+ counter.env_check = True
353
+ frame = np.zeros((100, 100, 3), dtype=np.uint8)
354
+ with patch("cv2.imshow") as mock_imshow, patch("cv2.waitKey", return_value=ord("q")) as mock_wait, patch(
355
+ "cv2.destroyAllWindows"
356
+ ) as mock_destroy:
357
+ counter.display_output(frame)
358
+ mock_imshow.assert_called_once()
359
+ mock_wait.assert_called_once()
360
+ mock_destroy.assert_called_once()
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.135"
3
+ __version__ = "8.3.138"
4
4
 
5
5
  import os
6
6
 
@@ -7,8 +7,6 @@ from pathlib import Path
7
7
  from types import SimpleNamespace
8
8
  from typing import Any, Dict, List, Union
9
9
 
10
- import cv2
11
-
12
10
  from ultralytics import __version__
13
11
  from ultralytics.utils import (
14
12
  ASSETS,
@@ -313,7 +311,7 @@ def get_cfg(cfg: Union[str, Path, Dict, SimpleNamespace] = DEFAULT_CFG_DICT, ove
313
311
  if k in cfg and isinstance(cfg[k], (int, float)):
314
312
  cfg[k] = str(cfg[k])
315
313
  if cfg.get("name") == "model": # assign model to 'name' arg
316
- cfg["name"] = str(cfg.get("model", "")).split(".")[0]
314
+ cfg["name"] = str(cfg.get("model", "")).partition(".")[0]
317
315
  LOGGER.warning(f"'name=model' automatically updated to 'name={cfg['name']}'.")
318
316
 
319
317
  # Type and Value checks
@@ -707,6 +705,8 @@ def handle_yolo_solutions(args: List[str]) -> None:
707
705
  ]
708
706
  )
709
707
  else:
708
+ import cv2 # Only needed for cap and vw functionality
709
+
710
710
  from ultralytics import solutions
711
711
 
712
712
  solution = getattr(solutions, SOLUTION_MAP[solution_name])(is_cli=True, **overrides) # class i.e ObjectCounter
@@ -919,7 +919,7 @@ def entrypoint(debug: str = "") -> None:
919
919
  if task not in TASKS:
920
920
  if task == "track":
921
921
  LOGGER.warning(
922
- "invalid 'task=track', setting 'task=detect' and 'mode=track'. Valid tasks are {TASKS}.\n{CLI_HELP_MSG}."
922
+ f"invalid 'task=track', setting 'task=detect' and 'mode=track'. Valid tasks are {TASKS}.\n{CLI_HELP_MSG}."
923
923
  )
924
924
  task, mode = "detect", "track"
925
925
  else:
ultralytics/data/base.py CHANGED
@@ -170,7 +170,7 @@ class BaseDataset(Dataset):
170
170
  # F += [p.parent / x.lstrip(os.sep) for x in t] # local to global path (pathlib)
171
171
  else:
172
172
  raise FileNotFoundError(f"{self.prefix}{p} does not exist")
173
- im_files = sorted(x.replace("/", os.sep) for x in f if x.split(".")[-1].lower() in IMG_FORMATS)
173
+ im_files = sorted(x.replace("/", os.sep) for x in f if x.rpartition(".")[-1].lower() in IMG_FORMATS)
174
174
  # self.img_files = sorted([x for x in f if x.suffix[1:].lower() in IMG_FORMATS]) # pathlib
175
175
  assert im_files, f"{self.prefix}No images found in {img_path}. {FORMATS_HELP_MSG}"
176
176
  except Exception as e:
ultralytics/data/build.py CHANGED
@@ -200,10 +200,11 @@ def check_source(source):
200
200
  webcam, screenshot, from_img, in_memory, tensor = False, False, False, False, False
201
201
  if isinstance(source, (str, int, Path)): # int for local usb camera
202
202
  source = str(source)
203
- is_file = Path(source).suffix[1:] in (IMG_FORMATS | VID_FORMATS)
204
- is_url = source.lower().startswith(("https://", "http://", "rtsp://", "rtmp://", "tcp://"))
203
+ source_lower = source.lower()
204
+ is_file = source_lower.rpartition(".")[-1] in (IMG_FORMATS | VID_FORMATS)
205
+ is_url = source_lower.startswith(("https://", "http://", "rtsp://", "rtmp://", "tcp://"))
205
206
  webcam = source.isnumeric() or source.endswith(".streams") or (is_url and not is_file)
206
- screenshot = source.lower() == "screen"
207
+ screenshot = source_lower == "screen"
207
208
  if is_url and is_file:
208
209
  source = check_file(source) # download
209
210
  elif isinstance(source, LOADERS):
@@ -353,7 +353,7 @@ class LoadImagesAndVideos:
353
353
  # Define files as images or videos
354
354
  images, videos = [], []
355
355
  for f in files:
356
- suffix = f.split(".")[-1].lower() # Get file extension without the dot and lowercase
356
+ suffix = f.rpartition(".")[-1].lower() # Get file extension without the dot and lowercase
357
357
  if suffix in IMG_FORMATS:
358
358
  images.append(f)
359
359
  elif suffix in VID_FORMATS:
@@ -427,7 +427,7 @@ class LoadImagesAndVideos:
427
427
  else:
428
428
  # Handle image files (including HEIC)
429
429
  self.mode = "image"
430
- if path.split(".")[-1].lower() == "heic":
430
+ if path.rpartition(".")[-1].lower() == "heic":
431
431
  # Load HEIC image using Pillow with pillow-heif
432
432
  check_requirements("pillow-heif")
433
433
 
@@ -244,7 +244,6 @@ class Exporter:
244
244
 
245
245
  def __call__(self, model=None) -> str:
246
246
  """Return list of exported files/dirs after running callbacks."""
247
- self.run_callbacks("on_export_start")
248
247
  t = time.time()
249
248
  fmt = self.args.format.lower() # to lowercase
250
249
  if fmt in {"tensorrt", "trt"}: # 'engine' aliases
@@ -277,7 +276,7 @@ class Exporter:
277
276
  LOGGER.warning("TensorRT requires GPU export, automatically assigning device=0")
278
277
  self.args.device = "0"
279
278
  if fmt == "engine" and "dla" in str(self.args.device): # convert int/list to str first
280
- dla = self.args.device.split(":")[-1]
279
+ dla = self.args.device.rsplit(":", 1)[-1]
281
280
  self.args.device = "0" # update device to "0"
282
281
  assert dla in {"0", "1"}, f"Expected self.args.device='dla:0' or 'dla:1, but got {self.args.device}."
283
282
  if imx and self.args.device is None and torch.cuda.is_available():
@@ -450,7 +449,7 @@ class Exporter:
450
449
  f"\n{colorstr('PyTorch:')} starting from '{file}' with input shape {tuple(im.shape)} BCHW and "
451
450
  f"output shape(s) {self.output_shape} ({file_size(file):.1f} MB)"
452
451
  )
453
-
452
+ self.run_callbacks("on_export_start")
454
453
  # Exports
455
454
  f = [""] * len(fmts) # exported filenames
456
455
  if jit or ncnn: # TorchScript
@@ -557,7 +556,7 @@ class Exporter:
557
556
  """YOLO ONNX export."""
558
557
  requirements = ["onnx>=1.12.0,<1.18.0"]
559
558
  if self.args.simplify:
560
- requirements += ["onnxslim>=0.1.46", "onnxruntime" + ("-gpu" if torch.cuda.is_available() else "")]
559
+ requirements += ["onnxslim>=0.1.53", "onnxruntime" + ("-gpu" if torch.cuda.is_available() else "")]
561
560
  check_requirements(requirements)
562
561
  import onnx # noqa
563
562
 
@@ -789,7 +788,7 @@ class Exporter:
789
788
  subprocess.run(cmd, check=True)
790
789
 
791
790
  # Remove debug files
792
- pnnx_files = [x.split("=")[-1] for x in pnnx_args]
791
+ pnnx_files = [x.rsplit("=", 1)[-1] for x in pnnx_args]
793
792
  for f_debug in ("debug.bin", "debug.param", "debug2.bin", "debug2.param", *pnnx_files):
794
793
  Path(f_debug).unlink(missing_ok=True)
795
794
 
@@ -928,7 +927,7 @@ class Exporter:
928
927
  "ai-edge-litert>=1.2.0", # required by 'onnx2tf' package
929
928
  "onnx>=1.12.0,<1.18.0",
930
929
  "onnx2tf>=1.26.3",
931
- "onnxslim>=0.1.46",
930
+ "onnxslim>=0.1.53",
932
931
  "onnxruntime-gpu" if cuda else "onnxruntime",
933
932
  "protobuf>=5",
934
933
  ),
@@ -1048,7 +1047,7 @@ class Exporter:
1048
1047
  "sudo apt-get install edgetpu-compiler",
1049
1048
  ):
1050
1049
  subprocess.run(c if is_sudo_available() else c.replace("sudo ", ""), shell=True, check=True)
1051
- ver = subprocess.run(cmd, shell=True, capture_output=True, check=True).stdout.decode().split()[-1]
1050
+ ver = subprocess.run(cmd, shell=True, capture_output=True, check=True).stdout.decode().rsplit(maxsplit=1)[-1]
1052
1051
 
1053
1052
  LOGGER.info(f"\n{prefix} starting export with Edge TPU compiler {ver}...")
1054
1053
  f = str(tflite_model).replace(".tflite", "_edgetpu.tflite") # Edge TPU model