ultralytics 8.2.61__tar.gz → 8.2.62__tar.gz

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.

Potentially problematic release.


This version of ultralytics might be problematic. Click here for more details.

Files changed (236) hide show
  1. {ultralytics-8.2.61/ultralytics.egg-info → ultralytics-8.2.62}/PKG-INFO +1 -1
  2. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/__init__.py +1 -1
  3. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/__init__.py +154 -103
  4. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/data/annotator.py +16 -12
  5. ultralytics-8.2.62/ultralytics/data/augment.py +2718 -0
  6. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/data/explorer/gui/dash.py +41 -26
  7. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/data/loaders.py +1 -1
  8. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/engine/model.py +483 -176
  9. ultralytics-8.2.62/ultralytics/engine/results.py +1628 -0
  10. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/fastsam/predict.py +1 -3
  11. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/nas/predict.py +1 -3
  12. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/rtdetr/predict.py +4 -6
  13. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/sam/predict.py +1 -3
  14. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/solutions/streamlit_inference.py +5 -2
  15. {ultralytics-8.2.61 → ultralytics-8.2.62/ultralytics.egg-info}/PKG-INFO +1 -1
  16. ultralytics-8.2.61/ultralytics/data/augment.py +0 -1435
  17. ultralytics-8.2.61/ultralytics/engine/results.py +0 -849
  18. {ultralytics-8.2.61 → ultralytics-8.2.62}/LICENSE +0 -0
  19. {ultralytics-8.2.61 → ultralytics-8.2.62}/README.md +0 -0
  20. {ultralytics-8.2.61 → ultralytics-8.2.62}/pyproject.toml +0 -0
  21. {ultralytics-8.2.61 → ultralytics-8.2.62}/setup.cfg +0 -0
  22. {ultralytics-8.2.61 → ultralytics-8.2.62}/tests/__init__.py +0 -0
  23. {ultralytics-8.2.61 → ultralytics-8.2.62}/tests/conftest.py +0 -0
  24. {ultralytics-8.2.61 → ultralytics-8.2.62}/tests/test_cli.py +0 -0
  25. {ultralytics-8.2.61 → ultralytics-8.2.62}/tests/test_cuda.py +0 -0
  26. {ultralytics-8.2.61 → ultralytics-8.2.62}/tests/test_engine.py +0 -0
  27. {ultralytics-8.2.61 → ultralytics-8.2.62}/tests/test_explorer.py +0 -0
  28. {ultralytics-8.2.61 → ultralytics-8.2.62}/tests/test_exports.py +0 -0
  29. {ultralytics-8.2.61 → ultralytics-8.2.62}/tests/test_integrations.py +0 -0
  30. {ultralytics-8.2.61 → ultralytics-8.2.62}/tests/test_python.py +0 -0
  31. {ultralytics-8.2.61 → ultralytics-8.2.62}/tests/test_solutions.py +0 -0
  32. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/assets/bus.jpg +0 -0
  33. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/assets/zidane.jpg +0 -0
  34. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/Argoverse.yaml +0 -0
  35. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/DOTAv1.5.yaml +0 -0
  36. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/DOTAv1.yaml +0 -0
  37. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/GlobalWheat2020.yaml +0 -0
  38. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/ImageNet.yaml +0 -0
  39. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/Objects365.yaml +0 -0
  40. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/SKU-110K.yaml +0 -0
  41. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/VOC.yaml +0 -0
  42. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/VisDrone.yaml +0 -0
  43. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/african-wildlife.yaml +0 -0
  44. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/brain-tumor.yaml +0 -0
  45. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/carparts-seg.yaml +0 -0
  46. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/coco-pose.yaml +0 -0
  47. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/coco.yaml +0 -0
  48. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/coco128-seg.yaml +0 -0
  49. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/coco128.yaml +0 -0
  50. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/coco8-pose.yaml +0 -0
  51. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/coco8-seg.yaml +0 -0
  52. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/coco8.yaml +0 -0
  53. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/crack-seg.yaml +0 -0
  54. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/dota8.yaml +0 -0
  55. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/lvis.yaml +0 -0
  56. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/open-images-v7.yaml +0 -0
  57. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/package-seg.yaml +0 -0
  58. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/signature.yaml +0 -0
  59. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/tiger-pose.yaml +0 -0
  60. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/datasets/xView.yaml +0 -0
  61. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/default.yaml +0 -0
  62. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/rt-detr/rtdetr-l.yaml +0 -0
  63. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/rt-detr/rtdetr-resnet101.yaml +0 -0
  64. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/rt-detr/rtdetr-resnet50.yaml +0 -0
  65. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/rt-detr/rtdetr-x.yaml +0 -0
  66. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v10/yolov10b.yaml +0 -0
  67. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v10/yolov10l.yaml +0 -0
  68. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v10/yolov10m.yaml +0 -0
  69. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v10/yolov10n.yaml +0 -0
  70. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v10/yolov10s.yaml +0 -0
  71. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v10/yolov10x.yaml +0 -0
  72. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v3/yolov3-spp.yaml +0 -0
  73. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v3/yolov3-tiny.yaml +0 -0
  74. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v3/yolov3.yaml +0 -0
  75. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v5/yolov5-p6.yaml +0 -0
  76. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v5/yolov5.yaml +0 -0
  77. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v6/yolov6.yaml +0 -0
  78. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v8/yolov8-cls-resnet101.yaml +0 -0
  79. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v8/yolov8-cls-resnet50.yaml +0 -0
  80. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v8/yolov8-cls.yaml +0 -0
  81. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v8/yolov8-ghost-p2.yaml +0 -0
  82. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v8/yolov8-ghost-p6.yaml +0 -0
  83. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v8/yolov8-ghost.yaml +0 -0
  84. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v8/yolov8-obb.yaml +0 -0
  85. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v8/yolov8-p2.yaml +0 -0
  86. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v8/yolov8-p6.yaml +0 -0
  87. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v8/yolov8-pose-p6.yaml +0 -0
  88. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v8/yolov8-pose.yaml +0 -0
  89. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v8/yolov8-rtdetr.yaml +0 -0
  90. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v8/yolov8-seg-p6.yaml +0 -0
  91. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v8/yolov8-seg.yaml +0 -0
  92. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v8/yolov8-world.yaml +0 -0
  93. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v8/yolov8-worldv2.yaml +0 -0
  94. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v8/yolov8.yaml +0 -0
  95. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v9/yolov9c-seg.yaml +0 -0
  96. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v9/yolov9c.yaml +0 -0
  97. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v9/yolov9e-seg.yaml +0 -0
  98. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v9/yolov9e.yaml +0 -0
  99. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v9/yolov9m.yaml +0 -0
  100. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v9/yolov9s.yaml +0 -0
  101. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/models/v9/yolov9t.yaml +0 -0
  102. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/trackers/botsort.yaml +0 -0
  103. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/cfg/trackers/bytetrack.yaml +0 -0
  104. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/data/__init__.py +0 -0
  105. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/data/base.py +0 -0
  106. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/data/build.py +0 -0
  107. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/data/converter.py +0 -0
  108. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/data/dataset.py +0 -0
  109. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/data/explorer/__init__.py +0 -0
  110. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/data/explorer/explorer.py +0 -0
  111. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/data/explorer/gui/__init__.py +0 -0
  112. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/data/explorer/utils.py +0 -0
  113. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/data/split_dota.py +0 -0
  114. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/data/utils.py +0 -0
  115. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/engine/__init__.py +0 -0
  116. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/engine/exporter.py +0 -0
  117. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/engine/predictor.py +0 -0
  118. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/engine/trainer.py +0 -0
  119. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/engine/tuner.py +0 -0
  120. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/engine/validator.py +0 -0
  121. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/hub/__init__.py +0 -0
  122. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/hub/auth.py +0 -0
  123. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/hub/session.py +0 -0
  124. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/hub/utils.py +0 -0
  125. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/__init__.py +0 -0
  126. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/fastsam/__init__.py +0 -0
  127. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/fastsam/model.py +0 -0
  128. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/fastsam/prompt.py +0 -0
  129. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/fastsam/utils.py +0 -0
  130. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/fastsam/val.py +0 -0
  131. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/nas/__init__.py +0 -0
  132. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/nas/model.py +0 -0
  133. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/nas/val.py +0 -0
  134. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/rtdetr/__init__.py +0 -0
  135. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/rtdetr/model.py +0 -0
  136. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/rtdetr/train.py +0 -0
  137. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/rtdetr/val.py +0 -0
  138. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/sam/__init__.py +0 -0
  139. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/sam/amg.py +0 -0
  140. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/sam/build.py +0 -0
  141. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/sam/model.py +0 -0
  142. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/sam/modules/__init__.py +0 -0
  143. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/sam/modules/decoders.py +0 -0
  144. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/sam/modules/encoders.py +0 -0
  145. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/sam/modules/sam.py +0 -0
  146. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/sam/modules/tiny_encoder.py +0 -0
  147. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/sam/modules/transformer.py +0 -0
  148. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/utils/__init__.py +0 -0
  149. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/utils/loss.py +0 -0
  150. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/utils/ops.py +0 -0
  151. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/__init__.py +0 -0
  152. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/classify/__init__.py +0 -0
  153. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/classify/predict.py +0 -0
  154. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/classify/train.py +0 -0
  155. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/classify/val.py +0 -0
  156. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/detect/__init__.py +0 -0
  157. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/detect/predict.py +0 -0
  158. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/detect/train.py +0 -0
  159. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/detect/val.py +0 -0
  160. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/model.py +0 -0
  161. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/obb/__init__.py +0 -0
  162. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/obb/predict.py +0 -0
  163. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/obb/train.py +0 -0
  164. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/obb/val.py +0 -0
  165. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/pose/__init__.py +0 -0
  166. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/pose/predict.py +0 -0
  167. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/pose/train.py +0 -0
  168. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/pose/val.py +0 -0
  169. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/segment/__init__.py +0 -0
  170. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/segment/predict.py +0 -0
  171. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/segment/train.py +0 -0
  172. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/segment/val.py +0 -0
  173. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/world/__init__.py +0 -0
  174. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/world/train.py +0 -0
  175. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/models/yolo/world/train_world.py +0 -0
  176. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/nn/__init__.py +0 -0
  177. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/nn/autobackend.py +0 -0
  178. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/nn/modules/__init__.py +0 -0
  179. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/nn/modules/block.py +0 -0
  180. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/nn/modules/conv.py +0 -0
  181. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/nn/modules/head.py +0 -0
  182. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/nn/modules/transformer.py +0 -0
  183. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/nn/modules/utils.py +0 -0
  184. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/nn/tasks.py +0 -0
  185. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/solutions/__init__.py +0 -0
  186. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/solutions/ai_gym.py +0 -0
  187. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/solutions/analytics.py +0 -0
  188. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/solutions/distance_calculation.py +0 -0
  189. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/solutions/heatmap.py +0 -0
  190. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/solutions/object_counter.py +0 -0
  191. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/solutions/parking_management.py +0 -0
  192. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/solutions/queue_management.py +0 -0
  193. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/solutions/speed_estimation.py +0 -0
  194. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/trackers/__init__.py +0 -0
  195. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/trackers/basetrack.py +0 -0
  196. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/trackers/bot_sort.py +0 -0
  197. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/trackers/byte_tracker.py +0 -0
  198. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/trackers/track.py +0 -0
  199. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/trackers/utils/__init__.py +0 -0
  200. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/trackers/utils/gmc.py +0 -0
  201. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/trackers/utils/kalman_filter.py +0 -0
  202. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/trackers/utils/matching.py +0 -0
  203. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/__init__.py +0 -0
  204. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/autobatch.py +0 -0
  205. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/benchmarks.py +0 -0
  206. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/callbacks/__init__.py +0 -0
  207. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/callbacks/base.py +0 -0
  208. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/callbacks/clearml.py +0 -0
  209. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/callbacks/comet.py +0 -0
  210. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/callbacks/dvc.py +0 -0
  211. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/callbacks/hub.py +0 -0
  212. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/callbacks/mlflow.py +0 -0
  213. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/callbacks/neptune.py +0 -0
  214. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/callbacks/raytune.py +0 -0
  215. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/callbacks/tensorboard.py +0 -0
  216. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/callbacks/wb.py +0 -0
  217. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/checks.py +0 -0
  218. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/dist.py +0 -0
  219. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/downloads.py +0 -0
  220. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/errors.py +0 -0
  221. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/files.py +0 -0
  222. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/instance.py +0 -0
  223. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/loss.py +0 -0
  224. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/metrics.py +0 -0
  225. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/ops.py +0 -0
  226. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/patches.py +0 -0
  227. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/plotting.py +0 -0
  228. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/tal.py +0 -0
  229. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/torch_utils.py +0 -0
  230. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/triton.py +0 -0
  231. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics/utils/tuner.py +0 -0
  232. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics.egg-info/SOURCES.txt +0 -0
  233. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics.egg-info/dependency_links.txt +0 -0
  234. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics.egg-info/entry_points.txt +0 -0
  235. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics.egg-info/requires.txt +0 -0
  236. {ultralytics-8.2.61 → ultralytics-8.2.62}/ultralytics.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ultralytics
3
- Version: 8.2.61
3
+ Version: 8.2.62
4
4
  Summary: Ultralytics YOLOv8 for SOTA object detection, multi-object tracking, instance segmentation, pose estimation and image classification.
5
5
  Author: Glenn Jocher, Ayush Chaurasia, Jing Qiu
6
6
  Maintainer: Glenn Jocher, Ayush Chaurasia, Jing Qiu
@@ -1,6 +1,6 @@
1
1
  # Ultralytics YOLO 🚀, AGPL-3.0 license
2
2
 
3
- __version__ = "8.2.61"
3
+ __version__ = "8.2.62"
4
4
 
5
5
  import os
6
6
 
@@ -79,7 +79,7 @@ CLI_HELP_MSG = f"""
79
79
  yolo export model=yolov8n-cls.pt format=onnx imgsz=224,128
80
80
 
81
81
  5. Explore your datasets using semantic search and SQL with a simple GUI powered by Ultralytics Explorer API
82
- yolo explorer
82
+ yolo explorer data=data.yaml model=yolov8n.pt
83
83
 
84
84
  6. Streamlit real-time object detection on your webcam with Ultralytics YOLOv8
85
85
  yolo streamlit-predict
@@ -187,11 +187,11 @@ CFG_BOOL_KEYS = { # boolean-only arguments
187
187
 
188
188
  def cfg2dict(cfg):
189
189
  """
190
- Convert a configuration object to a dictionary, whether it is a file path, a string, or a SimpleNamespace object.
190
+ Converts a configuration object to a dictionary.
191
191
 
192
192
  Args:
193
- cfg (str | Path | Dict | SimpleNamespace): Configuration object to be converted to a dictionary. This may be a
194
- path to a configuration file, a dictionary, or a SimpleNamespace object.
193
+ cfg (str | Path | Dict | SimpleNamespace): Configuration object to be converted. Can be a file path,
194
+ a string, a dictionary, or a SimpleNamespace object.
195
195
 
196
196
  Returns:
197
197
  (Dict): Configuration object in dictionary format.
@@ -209,8 +209,9 @@ def cfg2dict(cfg):
209
209
  >>> config_dict = cfg2dict({'param1': 'value1', 'param2': 'value2'})
210
210
 
211
211
  Notes:
212
- - If `cfg` is a path or a string, it will be loaded as YAML and converted to a dictionary.
213
- - If `cfg` is a SimpleNamespace object, it will be converted to a dictionary using `vars()`.
212
+ - If cfg is a path or string, it's loaded as YAML and converted to a dictionary.
213
+ - If cfg is a SimpleNamespace object, it's converted to a dictionary using vars().
214
+ - If cfg is already a dictionary, it's returned unchanged.
214
215
  """
215
216
  if isinstance(cfg, (str, Path)):
216
217
  cfg = yaml_load(cfg) # load dict
@@ -224,24 +225,23 @@ def get_cfg(cfg: Union[str, Path, Dict, SimpleNamespace] = DEFAULT_CFG_DICT, ove
224
225
  Load and merge configuration data from a file or dictionary, with optional overrides.
225
226
 
226
227
  Args:
227
- cfg (str | Path | Dict | SimpleNamespace): Configuration data source.
228
+ cfg (str | Path | Dict | SimpleNamespace): Configuration data source. Can be a file path, dictionary, or
229
+ SimpleNamespace object.
228
230
  overrides (Dict | None): Dictionary containing key-value pairs to override the base configuration.
229
231
 
230
232
  Returns:
231
- (SimpleNamespace): Namespace containing the merged training arguments.
232
-
233
- Notes:
234
- - If both `cfg` and `overrides` are provided, the values in `overrides` will take precedence.
235
- - Special handling ensures alignment and correctness of the configuration, such as converting numeric `project`
236
- and `name` to strings and validating configuration keys and values.
233
+ (SimpleNamespace): Namespace containing the merged configuration arguments.
237
234
 
238
235
  Examples:
239
- Load default configuration:
240
- >>> from ultralytics import get_cfg
241
- >>> config = get_cfg()
242
-
243
- Load from a custom file with overrides:
236
+ >>> from ultralytics.cfg import get_cfg
237
+ >>> config = get_cfg() # Load default configuration
244
238
  >>> config = get_cfg('path/to/config.yaml', overrides={'epochs': 50, 'batch_size': 16})
239
+
240
+ Notes:
241
+ - If both `cfg` and `overrides` are provided, the values in `overrides` will take precedence.
242
+ - Special handling ensures alignment and correctness of the configuration, such as converting numeric
243
+ `project` and `name` to strings and validating configuration keys and values.
244
+ - The function performs type and value checks on the configuration data.
245
245
  """
246
246
  cfg = cfg2dict(cfg)
247
247
 
@@ -270,24 +270,31 @@ def get_cfg(cfg: Union[str, Path, Dict, SimpleNamespace] = DEFAULT_CFG_DICT, ove
270
270
 
271
271
  def check_cfg(cfg, hard=True):
272
272
  """
273
- Checks configuration argument types and values for the Ultralytics library, ensuring correctness and converting them
274
- if necessary.
273
+ Checks configuration argument types and values for the Ultralytics library.
274
+
275
+ This function validates the types and values of configuration arguments, ensuring correctness and converting
276
+ them if necessary. It checks for specific key types defined in global variables such as CFG_FLOAT_KEYS,
277
+ CFG_FRACTION_KEYS, CFG_INT_KEYS, and CFG_BOOL_KEYS.
275
278
 
276
279
  Args:
277
280
  cfg (Dict): Configuration dictionary to validate.
278
281
  hard (bool): If True, raises exceptions for invalid types and values; if False, attempts to convert them.
279
282
 
280
283
  Examples:
281
- Validate a configuration with a mix of valid and invalid values:
282
284
  >>> config = {
283
- ... 'epochs': 50, # valid integer
284
- ... 'lr0': 0.01, # valid float
285
- ... 'momentum': 1.2, # invalid float (out of 0.0-1.0 range)
286
- ... 'save': 'true', # invalid bool
285
+ ... 'epochs': 50, # valid integer
286
+ ... 'lr0': 0.01, # valid float
287
+ ... 'momentum': 1.2, # invalid float (out of 0.0-1.0 range)
288
+ ... 'save': 'true', # invalid bool
287
289
  ... }
288
290
  >>> check_cfg(config, hard=False)
289
291
  >>> print(config)
290
- {'epochs': 50, 'lr0': 0.01, 'momentum': 1.2, 'save': False} # corrected 'save' key and retained other values
292
+ {'epochs': 50, 'lr0': 0.01, 'momentum': 1.2, 'save': False} # corrected 'save' key
293
+
294
+ Notes:
295
+ - The function modifies the input dictionary in-place.
296
+ - None values are ignored as they may be from optional arguments.
297
+ - Fraction keys are checked to be within the range [0.0, 1.0].
291
298
  """
292
299
  for k, v in cfg.items():
293
300
  if v is not None: # None values may be from optional args
@@ -328,16 +335,15 @@ def get_save_dir(args, name=None):
328
335
  Returns the directory path for saving outputs, derived from arguments or default settings.
329
336
 
330
337
  Args:
331
- args (SimpleNamespace): Namespace object containing configurations such as 'project', 'name', 'task', 'mode', and
332
- 'save_dir'.
333
- name (str | None): Optional name for the output directory. If not provided, it defaults to 'args.name' or the
334
- 'args.mode'.
338
+ args (SimpleNamespace): Namespace object containing configurations such as 'project', 'name', 'task',
339
+ 'mode', and 'save_dir'.
340
+ name (str | None): Optional name for the output directory. If not provided, it defaults to 'args.name'
341
+ or the 'args.mode'.
335
342
 
336
343
  Returns:
337
344
  (Path): Directory path where outputs should be saved.
338
345
 
339
346
  Examples:
340
- Generate a save directory using provided arguments
341
347
  >>> from types import SimpleNamespace
342
348
  >>> args = SimpleNamespace(project='my_project', task='detect', mode='train', exist_ok=True)
343
349
  >>> save_dir = get_save_dir(args)
@@ -369,6 +375,11 @@ def _handle_deprecation(custom):
369
375
  >>> _handle_deprecation(custom_config)
370
376
  >>> print(custom_config)
371
377
  {'show_boxes': True, 'show_labels': True, 'line_width': 2}
378
+
379
+ Notes:
380
+ This function modifies the input dictionary in-place, replacing deprecated keys with their current
381
+ equivalents. It also handles value conversions where necessary, such as inverting boolean values for
382
+ 'hide_labels' and 'hide_conf'.
372
383
  """
373
384
 
374
385
  for key in custom.copy().keys():
@@ -390,32 +401,29 @@ def _handle_deprecation(custom):
390
401
 
391
402
  def check_dict_alignment(base: Dict, custom: Dict, e=None):
392
403
  """
393
- Check for key alignment between custom and base configuration dictionaries, handling deprecated keys and providing
394
- informative error messages for mismatched keys.
404
+ Checks alignment between custom and base configuration dictionaries, handling deprecated keys and providing error
405
+ messages for mismatched keys.
395
406
 
396
407
  Args:
397
408
  base (Dict): The base configuration dictionary containing valid keys.
398
409
  custom (Dict): The custom configuration dictionary to be checked for alignment.
399
- e (Exception | None): Optional error instance passed by the calling function. Default is None.
410
+ e (Exception | None): Optional error instance passed by the calling function.
400
411
 
401
412
  Raises:
402
- SystemExit: Terminates the program execution if mismatched keys are found.
403
-
404
- Notes:
405
- - The function suggests corrections for mismatched keys based on similarity to valid keys.
406
- - Deprecated keys in the custom configuration are automatically replaced with their updated equivalents.
407
- - Detailed error messages are printed for each mismatched key to help users identify and correct their custom
408
- configurations.
413
+ SystemExit: If mismatched keys are found between the custom and base dictionaries.
409
414
 
410
415
  Examples:
411
416
  >>> base_cfg = {'epochs': 50, 'lr0': 0.01, 'batch_size': 16}
412
417
  >>> custom_cfg = {'epoch': 100, 'lr': 0.02, 'batch_size': 32}
413
-
414
418
  >>> try:
415
419
  ... check_dict_alignment(base_cfg, custom_cfg)
416
420
  ... except SystemExit:
417
- ... # Handle the error or correct the configuration
418
- ... pass
421
+ ... print("Mismatched keys found")
422
+
423
+ Notes:
424
+ - Suggests corrections for mismatched keys based on similarity to valid keys.
425
+ - Automatically replaces deprecated keys in the custom configuration with updated equivalents.
426
+ - Prints detailed error messages for each mismatched key to help users correct their configurations.
419
427
  """
420
428
  custom = _handle_deprecation(custom)
421
429
  base_keys, custom_keys = (set(x.keys()) for x in (base, custom))
@@ -434,7 +442,10 @@ def check_dict_alignment(base: Dict, custom: Dict, e=None):
434
442
 
435
443
  def merge_equals_args(args: List[str]) -> List[str]:
436
444
  """
437
- Merges arguments around isolated '=' in a list of strings.
445
+ Merges arguments around isolated '=' in a list of strings, handling three cases:
446
+ 1. ['arg', '=', 'val'] becomes ['arg=val'],
447
+ 2. ['arg=', 'val'] becomes ['arg=val'],
448
+ 3. ['arg', '=val'] becomes ['arg=val'].
438
449
 
439
450
  Args:
440
451
  args (List[str]): A list of strings where each element represents an argument.
@@ -443,20 +454,9 @@ def merge_equals_args(args: List[str]) -> List[str]:
443
454
  (List[str]): A list of strings where the arguments around isolated '=' are merged.
444
455
 
445
456
  Examples:
446
- Merge arguments where equals sign is separated:
447
- >>> args = ["arg1", "=", "value"]
457
+ >>> args = ["arg1", "=", "value", "arg2=", "value2", "arg3", "=value3"]
448
458
  >>> merge_equals_args(args)
449
- ["arg1=value"]
450
-
451
- Merge arguments where equals sign is at the end of the first argument:
452
- >>> args = ["arg1=", "value"]
453
- >>> merge_equals_args(args)
454
- ["arg1=value"]
455
-
456
- Merge arguments where equals sign is at the beginning of the second argument:
457
- >>> args = ["arg1", "=value"]
458
- >>> merge_equals_args(args)
459
- ["arg1=value"]
459
+ ['arg1=value', 'arg2=value2', 'arg3=value3']
460
460
  """
461
461
  new_args = []
462
462
  for i, arg in enumerate(args):
@@ -475,18 +475,24 @@ def merge_equals_args(args: List[str]) -> List[str]:
475
475
 
476
476
  def handle_yolo_hub(args: List[str]) -> None:
477
477
  """
478
- Handle Ultralytics HUB command-line interface (CLI) commands.
478
+ Handles Ultralytics HUB command-line interface (CLI) commands for authentication.
479
479
 
480
480
  This function processes Ultralytics HUB CLI commands such as login and logout. It should be called when executing a
481
481
  script with arguments related to HUB authentication.
482
482
 
483
483
  Args:
484
- args (List[str]): A list of command line arguments.
484
+ args (List[str]): A list of command line arguments. The first argument should be either 'login'
485
+ or 'logout'. For 'login', an optional second argument can be the API key.
485
486
 
486
487
  Examples:
487
488
  ```bash
488
489
  yolo hub login YOUR_API_KEY
489
490
  ```
491
+
492
+ Notes:
493
+ - The function imports the 'hub' module from ultralytics to perform login and logout operations.
494
+ - For the 'login' command, if no API key is provided, an empty string is passed to the login function.
495
+ - The 'logout' command does not require any additional arguments.
490
496
  """
491
497
  from ultralytics import hub
492
498
 
@@ -501,21 +507,26 @@ def handle_yolo_hub(args: List[str]) -> None:
501
507
 
502
508
  def handle_yolo_settings(args: List[str]) -> None:
503
509
  """
504
- Handle YOLO settings command-line interface (CLI) commands.
510
+ Handles YOLO settings command-line interface (CLI) commands.
505
511
 
506
- This function processes YOLO settings CLI commands such as reset. It should be called when executing a script with
507
- arguments related to YOLO settings management.
512
+ This function processes YOLO settings CLI commands such as reset and updating individual settings. It should be
513
+ called when executing a script with arguments related to YOLO settings management.
508
514
 
509
515
  Args:
510
516
  args (List[str]): A list of command line arguments for YOLO settings management.
511
517
 
512
518
  Examples:
513
- Reset YOLO settings:
514
- >>> yolo settings reset
519
+ >>> handle_yolo_settings(["reset"]) # Reset YOLO settings
520
+ >>> handle_yolo_settings(["default_cfg_path=yolov8n.yaml"]) # Update a specific setting
515
521
 
516
522
  Notes:
517
- For more information on handling YOLO settings, visit:
518
- https://docs.ultralytics.com/quickstart/#ultralytics-settings
523
+ - If no arguments are provided, the function will display the current settings.
524
+ - The 'reset' command will delete the existing settings file and create new default settings.
525
+ - Other arguments are treated as key-value pairs to update specific settings.
526
+ - The function will check for alignment between the provided settings and the existing ones.
527
+ - After processing, the updated settings will be displayed.
528
+ - For more information on handling YOLO settings, visit:
529
+ https://docs.ultralytics.com/quickstart/#ultralytics-settings
519
530
  """
520
531
  url = "https://docs.ultralytics.com/quickstart/#ultralytics-settings" # help URL
521
532
  try:
@@ -535,58 +546,83 @@ def handle_yolo_settings(args: List[str]) -> None:
535
546
  LOGGER.warning(f"WARNING ⚠️ settings error: '{e}'. Please see {url} for help.")
536
547
 
537
548
 
538
- def handle_explorer():
549
+ def handle_explorer(args: List[str]):
539
550
  """
540
- Open the Ultralytics Explorer GUI for dataset exploration and analysis.
541
-
542
551
  This function launches a graphical user interface that provides tools for interacting with and analyzing datasets
543
- using the Ultralytics Explorer API.
552
+ using the Ultralytics Explorer API. It checks for the required 'streamlit' package and informs the user that the
553
+ Explorer dashboard is loading.
554
+
555
+ Args:
556
+ args (List[str]): A list of optional command line arguments.
544
557
 
545
558
  Examples:
546
- Start the Ultralytics Explorer:
547
- >>> handle_explorer()
559
+ ```bash
560
+ yolo explorer data=data.yaml model=yolov8n.pt
561
+ ```
562
+
563
+ Notes:
564
+ - Requires 'streamlit' package version 1.29.0 or higher.
565
+ - The function does not take any arguments or return any values.
566
+ - It is typically called from the command line interface using the 'yolo explorer' command.
548
567
  """
549
568
  checks.check_requirements("streamlit>=1.29.0")
550
569
  LOGGER.info("💡 Loading Explorer dashboard...")
551
- subprocess.run(["streamlit", "run", ROOT / "data/explorer/gui/dash.py", "--server.maxMessageSize", "2048"])
570
+ cmd = ["streamlit", "run", ROOT / "data/explorer/gui/dash.py", "--server.maxMessageSize", "2048"]
571
+ new = dict(parse_key_value_pair(a) for a in args)
572
+ check_dict_alignment(base={k: DEFAULT_CFG_DICT[k] for k in ["model", "data"]}, custom=new)
573
+ for k, v in new.items():
574
+ cmd += [k, v]
575
+ subprocess.run(cmd)
552
576
 
553
577
 
554
578
  def handle_streamlit_inference():
555
579
  """
556
- Open the Ultralytics Live Inference streamlit app for real-time object detection.
580
+ Open the Ultralytics Live Inference Streamlit app for real-time object detection.
557
581
 
558
582
  This function initializes and runs a Streamlit application designed for performing live object detection using
559
- Ultralytics models.
560
-
561
- References:
562
- - Streamlit documentation: https://docs.streamlit.io/
563
- - Ultralytics: https://docs.ultralytics.com
583
+ Ultralytics models. It checks for the required Streamlit package and launches the app.
564
584
 
565
585
  Examples:
566
- To run the live inference Streamlit app, execute:
567
586
  >>> handle_streamlit_inference()
587
+
588
+ Notes:
589
+ - Requires Streamlit version 1.29.0 or higher.
590
+ - The app is launched using the 'streamlit run' command.
591
+ - The Streamlit app file is located in the Ultralytics package directory.
568
592
  """
569
593
  checks.check_requirements("streamlit>=1.29.0")
570
594
  LOGGER.info("💡 Loading Ultralytics Live Inference app...")
571
595
  subprocess.run(["streamlit", "run", ROOT / "solutions/streamlit_inference.py", "--server.headless", "true"])
572
596
 
573
597
 
574
- def parse_key_value_pair(pair):
598
+ def parse_key_value_pair(pair: str = "key=value"):
575
599
  """
576
- Parse a 'key=value' pair and return the key and value.
600
+ Parses a key-value pair string into separate key and value components.
577
601
 
578
602
  Args:
579
- pair (str): The 'key=value' string to be parsed.
603
+ pair (str): A string containing a key-value pair in the format "key=value".
580
604
 
581
605
  Returns:
582
- (tuple[str, str]): A tuple containing the key and value as separate strings.
606
+ (tuple): A tuple containing two elements:
607
+ - key (str): The parsed key.
608
+ - value (str): The parsed value.
609
+
610
+ Raises:
611
+ AssertionError: If the value is missing or empty.
583
612
 
584
613
  Examples:
585
614
  >>> key, value = parse_key_value_pair("model=yolov8n.pt")
586
- >>> key
587
- 'model'
588
- >>> value
589
- 'yolov8n.pt
615
+ >>> print(f"Key: {key}, Value: {value}")
616
+ Key: model, Value: yolov8n.pt
617
+
618
+ >>> key, value = parse_key_value_pair("epochs=100")
619
+ >>> print(f"Key: {key}, Value: {value}")
620
+ Key: epochs, Value: 100
621
+
622
+ Notes:
623
+ - The function splits the input string on the first '=' character.
624
+ - Leading and trailing whitespace is removed from both key and value.
625
+ - An assertion error is raised if the value is empty after stripping.
590
626
  """
591
627
  k, v = pair.split("=", 1) # split on first '=' sign
592
628
  k, v = k.strip(), v.strip() # remove spaces
@@ -596,17 +632,19 @@ def parse_key_value_pair(pair):
596
632
 
597
633
  def smart_value(v):
598
634
  """
599
- Convert a string representation of a value into its appropriate Python type (int, float, bool, None, etc.).
635
+ Converts a string representation of a value to its appropriate Python type.
636
+
637
+ This function attempts to convert a given string into a Python object of the most appropriate type. It handles
638
+ conversions to None, bool, int, float, and other types that can be evaluated safely.
600
639
 
601
640
  Args:
602
- v (str): String representation of the value to be converted.
641
+ v (str): The string representation of the value to be converted.
603
642
 
604
643
  Returns:
605
- (Any): The converted value, which can be of type int, float, bool, None, or the original string if no conversion
644
+ (Any): The converted value. The type can be None, bool, int, float, or the original string if no conversion
606
645
  is applicable.
607
646
 
608
647
  Examples:
609
- Convert a string to various types:
610
648
  >>> smart_value("42")
611
649
  42
612
650
  >>> smart_value("3.14")
@@ -617,6 +655,11 @@ def smart_value(v):
617
655
  None
618
656
  >>> smart_value("some_string")
619
657
  'some_string'
658
+
659
+ Notes:
660
+ - The function uses a case-insensitive comparison for boolean and None values.
661
+ - For other types, it attempts to use Python's eval() function, which can be unsafe if used on untrusted input.
662
+ - If no conversion is possible, the original string is returned.
620
663
  """
621
664
  v_lower = v.lower()
622
665
  if v_lower == "none":
@@ -639,7 +682,7 @@ def entrypoint(debug=""):
639
682
  executing the corresponding tasks such as training, validation, prediction, exporting models, and more.
640
683
 
641
684
  Args:
642
- debug (str, optional): Space-separated string of command-line arguments for debugging purposes.
685
+ debug (str): Space-separated string of command-line arguments for debugging purposes.
643
686
 
644
687
  Examples:
645
688
  Train a detection model for 10 epochs with an initial learning_rate of 0.01:
@@ -652,9 +695,9 @@ def entrypoint(debug=""):
652
695
  >>> entrypoint("val model=yolov8n.pt data=coco8.yaml batch=1 imgsz=640")
653
696
 
654
697
  Notes:
655
- - For a list of all available commands and their arguments, see the provided help messages and the Ultralytics
656
- documentation at https://docs.ultralytics.com.
657
698
  - If no arguments are passed, the function will display the usage help message.
699
+ - For a list of all available commands and their arguments, see the provided help messages and the
700
+ Ultralytics documentation at https://docs.ultralytics.com.
658
701
  """
659
702
  args = (debug.split(" ") if debug else ARGV)[1:]
660
703
  if not args: # no arguments passed
@@ -670,7 +713,7 @@ def entrypoint(debug=""):
670
713
  "hub": lambda: handle_yolo_hub(args[1:]),
671
714
  "login": lambda: handle_yolo_hub(args),
672
715
  "copy-cfg": copy_default_cfg,
673
- "explorer": lambda: handle_explorer(),
716
+ "explorer": lambda: handle_explorer(args[1:]),
674
717
  "streamlit-predict": lambda: handle_streamlit_inference(),
675
718
  }
676
719
  full_args_dict = {**DEFAULT_CFG_DICT, **{k: None for k in TASKS}, **{k: None for k in MODES}, **special}
@@ -793,16 +836,24 @@ def entrypoint(debug=""):
793
836
  # Special modes --------------------------------------------------------------------------------------------------------
794
837
  def copy_default_cfg():
795
838
  """
796
- Copy and create a new default configuration file with '_copy' appended to its name, providing a usage example.
839
+ Copies the default configuration file and creates a new one with '_copy' appended to its name.
797
840
 
798
- This function duplicates the existing default configuration file and appends '_copy' to its name in the current
799
- working directory.
841
+ This function duplicates the existing default configuration file (DEFAULT_CFG_PATH) and saves it
842
+ with '_copy' appended to its name in the current working directory. It provides a convenient way
843
+ to create a custom configuration file based on the default settings.
800
844
 
801
845
  Examples:
802
- Copy the default configuration file and use it in a YOLO command:
803
846
  >>> copy_default_cfg()
804
- >>> # Example YOLO command with this new custom cfg:
805
- >>> # yolo cfg='default_copy.yaml' imgsz=320 batch=8
847
+ # Output: default.yaml copied to /path/to/current/directory/default_copy.yaml
848
+ # Example YOLO command with this new custom cfg:
849
+ # yolo cfg='/path/to/current/directory/default_copy.yaml' imgsz=320 batch=8
850
+
851
+ Notes:
852
+ - The new configuration file is created in the current working directory.
853
+ - After copying, the function prints a message with the new file's location and an example
854
+ YOLO command demonstrating how to use the new configuration file.
855
+ - This function is useful for users who want to modify the default configuration without
856
+ altering the original file.
806
857
  """
807
858
  new_file = Path.cwd() / DEFAULT_CFG_PATH.name.replace(".yaml", "_copy.yaml")
808
859
  shutil.copy2(DEFAULT_CFG_PATH, new_file)
@@ -9,20 +9,24 @@ def auto_annotate(data, det_model="yolov8x.pt", sam_model="sam_b.pt", device="",
9
9
  """
10
10
  Automatically annotates images using a YOLO object detection model and a SAM segmentation model.
11
11
 
12
+ This function processes images in a specified directory, detects objects using a YOLO model, and then generates
13
+ segmentation masks using a SAM model. The resulting annotations are saved as text files.
14
+
12
15
  Args:
13
16
  data (str): Path to a folder containing images to be annotated.
14
- det_model (str, optional): Pre-trained YOLO detection model. Defaults to 'yolov8x.pt'.
15
- sam_model (str, optional): Pre-trained SAM segmentation model. Defaults to 'sam_b.pt'.
16
- device (str, optional): Device to run the models on. Defaults to an empty string (CPU or GPU, if available).
17
- output_dir (str | None | optional): Directory to save the annotated results.
18
- Defaults to a 'labels' folder in the same directory as 'data'.
19
-
20
- Example:
21
- ```python
22
- from ultralytics.data.annotator import auto_annotate
23
-
24
- auto_annotate(data='ultralytics/assets', det_model='yolov8n.pt', sam_model='mobile_sam.pt')
25
- ```
17
+ det_model (str): Path or name of the pre-trained YOLO detection model.
18
+ sam_model (str): Path or name of the pre-trained SAM segmentation model.
19
+ device (str): Device to run the models on (e.g., 'cpu', 'cuda', '0').
20
+ output_dir (str | None): Directory to save the annotated results. If None, a default directory is created.
21
+
22
+ Examples:
23
+ >>> from ultralytics.data.annotator import auto_annotate
24
+ >>> auto_annotate(data='ultralytics/assets', det_model='yolov8n.pt', sam_model='mobile_sam.pt')
25
+
26
+ Notes:
27
+ - The function creates a new directory for output if not specified.
28
+ - Annotation results are saved as text files with the same names as the input images.
29
+ - Each line in the output text file represents a detected object with its class ID and segmentation points.
26
30
  """
27
31
  det_model = YOLO(det_model)
28
32
  sam_model = SAM(sam_model)