ultralytics 8.3.54__tar.gz → 8.3.55__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.
Files changed (245) hide show
  1. {ultralytics-8.3.54/ultralytics.egg-info → ultralytics-8.3.55}/PKG-INFO +1 -1
  2. {ultralytics-8.3.54 → ultralytics-8.3.55}/tests/__init__.py +0 -1
  3. {ultralytics-8.3.54 → ultralytics-8.3.55}/tests/conftest.py +2 -2
  4. {ultralytics-8.3.54 → ultralytics-8.3.55}/tests/test_cli.py +2 -1
  5. {ultralytics-8.3.54 → ultralytics-8.3.55}/tests/test_python.py +2 -2
  6. {ultralytics-8.3.54 → ultralytics-8.3.55}/tests/test_solutions.py +10 -8
  7. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/__init__.py +1 -1
  8. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/__init__.py +2 -2
  9. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/coco-pose.yaml +4 -4
  10. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/lvis.yaml +1 -1
  11. ultralytics-8.3.55/ultralytics/cfg/datasets/medical-pills.yaml +21 -0
  12. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/solutions/default.yaml +1 -1
  13. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/data/augment.py +6 -3
  14. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/data/dataset.py +2 -2
  15. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/engine/exporter.py +1 -1
  16. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/engine/model.py +22 -24
  17. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/engine/validator.py +1 -1
  18. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/sam/modules/tiny_encoder.py +2 -1
  19. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/sam/predict.py +1 -1
  20. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/nn/autobackend.py +7 -10
  21. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/solutions/analytics.py +1 -1
  22. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/solutions/distance_calculation.py +2 -0
  23. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/solutions/heatmap.py +1 -0
  24. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/solutions/parking_management.py +22 -13
  25. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/solutions/region_counter.py +4 -0
  26. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/solutions/security_alarm.py +7 -5
  27. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/solutions/solutions.py +8 -0
  28. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/solutions/streamlit_inference.py +21 -17
  29. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/benchmarks.py +2 -1
  30. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/downloads.py +1 -1
  31. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/instance.py +1 -1
  32. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/metrics.py +3 -4
  33. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/plotting.py +2 -1
  34. {ultralytics-8.3.54 → ultralytics-8.3.55/ultralytics.egg-info}/PKG-INFO +1 -1
  35. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics.egg-info/SOURCES.txt +1 -0
  36. {ultralytics-8.3.54 → ultralytics-8.3.55}/LICENSE +0 -0
  37. {ultralytics-8.3.54 → ultralytics-8.3.55}/README.md +0 -0
  38. {ultralytics-8.3.54 → ultralytics-8.3.55}/pyproject.toml +0 -0
  39. {ultralytics-8.3.54 → ultralytics-8.3.55}/setup.cfg +0 -0
  40. {ultralytics-8.3.54 → ultralytics-8.3.55}/tests/test_cuda.py +0 -0
  41. {ultralytics-8.3.54 → ultralytics-8.3.55}/tests/test_engine.py +0 -0
  42. {ultralytics-8.3.54 → ultralytics-8.3.55}/tests/test_exports.py +0 -0
  43. {ultralytics-8.3.54 → ultralytics-8.3.55}/tests/test_integrations.py +0 -0
  44. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/assets/bus.jpg +0 -0
  45. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/assets/zidane.jpg +0 -0
  46. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/Argoverse.yaml +0 -0
  47. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/DOTAv1.5.yaml +0 -0
  48. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/DOTAv1.yaml +0 -0
  49. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/GlobalWheat2020.yaml +0 -0
  50. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/ImageNet.yaml +0 -0
  51. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/Objects365.yaml +0 -0
  52. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/SKU-110K.yaml +0 -0
  53. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/VOC.yaml +0 -0
  54. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/VisDrone.yaml +0 -0
  55. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/african-wildlife.yaml +0 -0
  56. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/brain-tumor.yaml +0 -0
  57. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/carparts-seg.yaml +0 -0
  58. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/coco.yaml +0 -0
  59. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/coco128-seg.yaml +0 -0
  60. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/coco128.yaml +0 -0
  61. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/coco8-pose.yaml +0 -0
  62. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/coco8-seg.yaml +0 -0
  63. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/coco8.yaml +0 -0
  64. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/crack-seg.yaml +0 -0
  65. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/dog-pose.yaml +0 -0
  66. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/dota8.yaml +0 -0
  67. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/hand-keypoints.yaml +0 -0
  68. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/open-images-v7.yaml +0 -0
  69. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/package-seg.yaml +0 -0
  70. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/signature.yaml +0 -0
  71. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/tiger-pose.yaml +0 -0
  72. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/datasets/xView.yaml +0 -0
  73. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/default.yaml +0 -0
  74. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/11/yolo11-cls.yaml +0 -0
  75. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/11/yolo11-obb.yaml +0 -0
  76. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/11/yolo11-pose.yaml +0 -0
  77. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/11/yolo11-seg.yaml +0 -0
  78. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/11/yolo11.yaml +0 -0
  79. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/rt-detr/rtdetr-l.yaml +0 -0
  80. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/rt-detr/rtdetr-resnet101.yaml +0 -0
  81. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/rt-detr/rtdetr-resnet50.yaml +0 -0
  82. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/rt-detr/rtdetr-x.yaml +0 -0
  83. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v10/yolov10b.yaml +0 -0
  84. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v10/yolov10l.yaml +0 -0
  85. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v10/yolov10m.yaml +0 -0
  86. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v10/yolov10n.yaml +0 -0
  87. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v10/yolov10s.yaml +0 -0
  88. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v10/yolov10x.yaml +0 -0
  89. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v3/yolov3-spp.yaml +0 -0
  90. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v3/yolov3-tiny.yaml +0 -0
  91. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v3/yolov3.yaml +0 -0
  92. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v5/yolov5-p6.yaml +0 -0
  93. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v5/yolov5.yaml +0 -0
  94. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v6/yolov6.yaml +0 -0
  95. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v8/yolov8-cls-resnet101.yaml +0 -0
  96. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v8/yolov8-cls-resnet50.yaml +0 -0
  97. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v8/yolov8-cls.yaml +0 -0
  98. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v8/yolov8-ghost-p2.yaml +0 -0
  99. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v8/yolov8-ghost-p6.yaml +0 -0
  100. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v8/yolov8-ghost.yaml +0 -0
  101. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v8/yolov8-obb.yaml +0 -0
  102. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v8/yolov8-p2.yaml +0 -0
  103. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v8/yolov8-p6.yaml +0 -0
  104. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v8/yolov8-pose-p6.yaml +0 -0
  105. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v8/yolov8-pose.yaml +0 -0
  106. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v8/yolov8-rtdetr.yaml +0 -0
  107. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v8/yolov8-seg-p6.yaml +0 -0
  108. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v8/yolov8-seg.yaml +0 -0
  109. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v8/yolov8-world.yaml +0 -0
  110. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v8/yolov8-worldv2.yaml +0 -0
  111. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v8/yolov8.yaml +0 -0
  112. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v9/yolov9c-seg.yaml +0 -0
  113. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v9/yolov9c.yaml +0 -0
  114. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v9/yolov9e-seg.yaml +0 -0
  115. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v9/yolov9e.yaml +0 -0
  116. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v9/yolov9m.yaml +0 -0
  117. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v9/yolov9s.yaml +0 -0
  118. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/models/v9/yolov9t.yaml +0 -0
  119. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/trackers/botsort.yaml +0 -0
  120. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/cfg/trackers/bytetrack.yaml +0 -0
  121. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/data/__init__.py +0 -0
  122. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/data/annotator.py +0 -0
  123. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/data/base.py +0 -0
  124. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/data/build.py +0 -0
  125. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/data/converter.py +0 -0
  126. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/data/loaders.py +0 -0
  127. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/data/split_dota.py +0 -0
  128. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/data/utils.py +0 -0
  129. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/engine/__init__.py +0 -0
  130. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/engine/predictor.py +0 -0
  131. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/engine/results.py +0 -0
  132. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/engine/trainer.py +0 -0
  133. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/engine/tuner.py +0 -0
  134. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/hub/__init__.py +0 -0
  135. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/hub/auth.py +0 -0
  136. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/hub/google/__init__.py +0 -0
  137. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/hub/session.py +0 -0
  138. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/hub/utils.py +0 -0
  139. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/__init__.py +0 -0
  140. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/fastsam/__init__.py +0 -0
  141. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/fastsam/model.py +0 -0
  142. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/fastsam/predict.py +0 -0
  143. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/fastsam/utils.py +0 -0
  144. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/fastsam/val.py +0 -0
  145. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/nas/__init__.py +0 -0
  146. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/nas/model.py +0 -0
  147. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/nas/predict.py +0 -0
  148. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/nas/val.py +0 -0
  149. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/rtdetr/__init__.py +0 -0
  150. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/rtdetr/model.py +0 -0
  151. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/rtdetr/predict.py +0 -0
  152. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/rtdetr/train.py +0 -0
  153. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/rtdetr/val.py +0 -0
  154. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/sam/__init__.py +0 -0
  155. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/sam/amg.py +0 -0
  156. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/sam/build.py +0 -0
  157. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/sam/model.py +0 -0
  158. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/sam/modules/__init__.py +0 -0
  159. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/sam/modules/blocks.py +0 -0
  160. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/sam/modules/decoders.py +0 -0
  161. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/sam/modules/encoders.py +0 -0
  162. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/sam/modules/memory_attention.py +0 -0
  163. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/sam/modules/sam.py +0 -0
  164. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/sam/modules/transformer.py +0 -0
  165. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/sam/modules/utils.py +0 -0
  166. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/utils/__init__.py +0 -0
  167. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/utils/loss.py +0 -0
  168. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/utils/ops.py +0 -0
  169. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/__init__.py +0 -0
  170. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/classify/__init__.py +0 -0
  171. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/classify/predict.py +0 -0
  172. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/classify/train.py +0 -0
  173. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/classify/val.py +0 -0
  174. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/detect/__init__.py +0 -0
  175. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/detect/predict.py +0 -0
  176. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/detect/train.py +0 -0
  177. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/detect/val.py +0 -0
  178. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/model.py +0 -0
  179. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/obb/__init__.py +0 -0
  180. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/obb/predict.py +0 -0
  181. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/obb/train.py +0 -0
  182. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/obb/val.py +0 -0
  183. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/pose/__init__.py +0 -0
  184. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/pose/predict.py +0 -0
  185. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/pose/train.py +0 -0
  186. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/pose/val.py +0 -0
  187. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/segment/__init__.py +0 -0
  188. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/segment/predict.py +0 -0
  189. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/segment/train.py +0 -0
  190. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/segment/val.py +0 -0
  191. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/world/__init__.py +0 -0
  192. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/world/train.py +0 -0
  193. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/models/yolo/world/train_world.py +0 -0
  194. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/nn/__init__.py +0 -0
  195. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/nn/modules/__init__.py +0 -0
  196. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/nn/modules/activation.py +0 -0
  197. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/nn/modules/block.py +0 -0
  198. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/nn/modules/conv.py +0 -0
  199. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/nn/modules/head.py +0 -0
  200. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/nn/modules/transformer.py +0 -0
  201. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/nn/modules/utils.py +0 -0
  202. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/nn/tasks.py +0 -0
  203. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/solutions/__init__.py +0 -0
  204. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/solutions/ai_gym.py +0 -0
  205. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/solutions/object_counter.py +0 -0
  206. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/solutions/queue_management.py +0 -0
  207. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/solutions/speed_estimation.py +0 -0
  208. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/solutions/trackzone.py +0 -0
  209. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/trackers/__init__.py +0 -0
  210. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/trackers/basetrack.py +0 -0
  211. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/trackers/bot_sort.py +0 -0
  212. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/trackers/byte_tracker.py +0 -0
  213. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/trackers/track.py +0 -0
  214. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/trackers/utils/__init__.py +0 -0
  215. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/trackers/utils/gmc.py +0 -0
  216. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/trackers/utils/kalman_filter.py +0 -0
  217. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/trackers/utils/matching.py +0 -0
  218. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/__init__.py +0 -0
  219. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/autobatch.py +0 -0
  220. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/callbacks/__init__.py +0 -0
  221. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/callbacks/base.py +0 -0
  222. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/callbacks/clearml.py +0 -0
  223. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/callbacks/comet.py +0 -0
  224. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/callbacks/dvc.py +0 -0
  225. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/callbacks/hub.py +0 -0
  226. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/callbacks/mlflow.py +0 -0
  227. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/callbacks/neptune.py +0 -0
  228. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/callbacks/raytune.py +0 -0
  229. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/callbacks/tensorboard.py +0 -0
  230. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/callbacks/wb.py +0 -0
  231. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/checks.py +0 -0
  232. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/dist.py +0 -0
  233. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/errors.py +0 -0
  234. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/files.py +0 -0
  235. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/loss.py +0 -0
  236. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/ops.py +0 -0
  237. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/patches.py +0 -0
  238. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/tal.py +0 -0
  239. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/torch_utils.py +0 -0
  240. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/triton.py +0 -0
  241. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics/utils/tuner.py +0 -0
  242. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics.egg-info/dependency_links.txt +0 -0
  243. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics.egg-info/entry_points.txt +0 -0
  244. {ultralytics-8.3.54 → ultralytics-8.3.55}/ultralytics.egg-info/requires.txt +0 -0
  245. {ultralytics-8.3.54 → ultralytics-8.3.55}/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.3.54
3
+ Version: 8.3.55
4
4
  Summary: Ultralytics YOLO 🚀 for SOTA object detection, multi-object tracking, instance segmentation, pose estimation and image classification.
5
5
  Author-email: Glenn Jocher <glenn.jocher@ultralytics.com>, Jing Qiu <jing.qiu@ultralytics.com>
6
6
  Maintainer-email: Ultralytics <hello@ultralytics.com>
@@ -17,7 +17,6 @@ __all__ = (
17
17
  "SOURCE",
18
18
  "SOURCES_LIST",
19
19
  "TMP",
20
- "IS_TMP_WRITEABLE",
21
20
  "CUDA_IS_AVAILABLE",
22
21
  "CUDA_DEVICE_COUNT",
23
22
  )
@@ -74,10 +74,10 @@ def pytest_terminal_summary(terminalreporter, exitstatus, config):
74
74
 
75
75
  # Remove files
76
76
  models = [path for x in ["*.onnx", "*.torchscript"] for path in WEIGHTS_DIR.rglob(x)]
77
- for file in ["bus.jpg", "yolo11n.onnx", "yolo11n.torchscript"] + models:
77
+ for file in ["decelera_portrait_min.mov", "bus.jpg", "yolo11n.onnx", "yolo11n.torchscript"] + models:
78
78
  Path(file).unlink(missing_ok=True)
79
79
 
80
80
  # Remove directories
81
81
  models = [path for x in ["*.mlpackage", "*_openvino_model"] for path in WEIGHTS_DIR.rglob(x)]
82
- for directory in [TMP.parents[1] / ".pytest_cache", TMP] + models:
82
+ for directory in [WEIGHTS_DIR / "path with spaces", TMP.parents[1] / ".pytest_cache", TMP] + models:
83
83
  shutil.rmtree(directory, ignore_errors=True)
@@ -59,7 +59,8 @@ def test_rtdetr(task="detect", model="yolov8n-rtdetr.yaml", data="coco8.yaml"):
59
59
  run(f"yolo train {task} model={model} data={data} --imgsz= 160 epochs =1, cache = disk fraction=0.25")
60
60
  run(f"yolo predict {task} model={model} source={ASSETS / 'bus.jpg'} imgsz=160 save save_crop save_txt")
61
61
  if TORCH_1_9:
62
- run(f"yolo predict {task} model='rtdetr-l.pt' source={ASSETS / 'bus.jpg'} imgsz=160 save save_crop save_txt")
62
+ weights = WEIGHTS_DIR / "rtdetr-l.pt"
63
+ run(f"yolo predict {task} model={weights} source={ASSETS / 'bus.jpg'} imgsz=160 save save_crop save_txt")
63
64
 
64
65
 
65
66
  @pytest.mark.skipif(checks.IS_PYTHON_3_12, reason="MobileSAM with CLIP is not supported in Python 3.12")
@@ -576,11 +576,11 @@ def test_model_embeddings():
576
576
  @pytest.mark.skipif(checks.IS_PYTHON_3_12, reason="YOLOWorld with CLIP is not supported in Python 3.12")
577
577
  def test_yolo_world():
578
578
  """Tests YOLO world models with CLIP support, including detection and training scenarios."""
579
- model = YOLO("yolov8s-world.pt") # no YOLO11n-world model yet
579
+ model = YOLO(WEIGHTS_DIR / "yolov8s-world.pt") # no YOLO11n-world model yet
580
580
  model.set_classes(["tree", "window"])
581
581
  model(SOURCE, conf=0.01)
582
582
 
583
- model = YOLO("yolov8s-worldv2.pt") # no YOLO11n-world model yet
583
+ model = YOLO(WEIGHTS_DIR / "yolov8s-worldv2.pt") # no YOLO11n-world model yet
584
584
  # Training from a pretrained model. Eval is included at the final stage of training.
585
585
  # Use dota8.yaml which has fewer categories to reduce the inference time of CLIP model
586
586
  model.train(
@@ -3,18 +3,20 @@
3
3
  import cv2
4
4
  import pytest
5
5
 
6
+ from tests import TMP
6
7
  from ultralytics import YOLO, solutions
8
+ from ultralytics.utils import ASSETS_URL, WEIGHTS_DIR
7
9
  from ultralytics.utils.downloads import safe_download
8
10
 
9
- MAJOR_SOLUTIONS_DEMO = "https://github.com/ultralytics/assets/releases/download/v0.0.0/solutions_ci_demo.mp4"
10
- WORKOUTS_SOLUTION_DEMO = "https://github.com/ultralytics/assets/releases/download/v0.0.0/solution_ci_pose_demo.mp4"
11
+ DEMO_VIDEO = "solutions_ci_demo.mp4"
12
+ POSE_VIDEO = "solution_ci_pose_demo.mp4"
11
13
 
12
14
 
13
15
  @pytest.mark.slow
14
16
  def test_major_solutions():
15
17
  """Test the object counting, heatmap, speed estimation and queue management solution."""
16
- safe_download(url=MAJOR_SOLUTIONS_DEMO)
17
- cap = cv2.VideoCapture("solutions_ci_demo.mp4")
18
+ safe_download(url=f"{ASSETS_URL}/{DEMO_VIDEO}", dir=TMP)
19
+ cap = cv2.VideoCapture(str(TMP / DEMO_VIDEO))
18
20
  assert cap.isOpened(), "Error reading video file"
19
21
  region_points = [(20, 400), (1080, 400), (1080, 360), (20, 360)]
20
22
  counter = solutions.ObjectCounter(region=region_points, model="yolo11n.pt", show=False) # Test object counter
@@ -42,8 +44,8 @@ def test_major_solutions():
42
44
  cap.release()
43
45
 
44
46
  # Test workouts monitoring
45
- safe_download(url=WORKOUTS_SOLUTION_DEMO)
46
- cap1 = cv2.VideoCapture("solution_ci_pose_demo.mp4")
47
+ safe_download(url=f"{ASSETS_URL}/{POSE_VIDEO}", dir=TMP)
48
+ cap1 = cv2.VideoCapture(str(TMP / POSE_VIDEO))
47
49
  assert cap1.isOpened(), "Error reading video file"
48
50
  gym = solutions.AIGym(line_width=2, kpts=[5, 11, 13], show=False)
49
51
  while cap1.isOpened():
@@ -59,9 +61,9 @@ def test_instance_segmentation():
59
61
  """Test the instance segmentation solution."""
60
62
  from ultralytics.utils.plotting import Annotator, colors
61
63
 
62
- model = YOLO("yolo11n-seg.pt")
64
+ model = YOLO(WEIGHTS_DIR / "yolo11n-seg.pt")
63
65
  names = model.names
64
- cap = cv2.VideoCapture("solutions_ci_demo.mp4")
66
+ cap = cv2.VideoCapture(TMP / DEMO_VIDEO)
65
67
  assert cap.isOpened(), "Error reading video file"
66
68
  while cap.isOpened():
67
69
  success, im0 = cap.read()
@@ -1,6 +1,6 @@
1
1
  # Ultralytics YOLO 🚀, AGPL-3.0 license
2
2
 
3
- __version__ = "8.3.54"
3
+ __version__ = "8.3.55"
4
4
 
5
5
  import os
6
6
 
@@ -86,7 +86,7 @@ SOLUTIONS_HELP_MSG = f"""
86
86
  yolo solutions count source="path/to/video/file.mp4" region=[(20, 400), (1080, 400), (1080, 360), (20, 360)]
87
87
 
88
88
  2. Call heatmaps solution
89
- yolo solutions heatmap colormap=cv2.COLORMAP_PARAULA model=yolo11n.pt
89
+ yolo solutions heatmap colormap=cv2.COLORMAP_PARULA model=yolo11n.pt
90
90
 
91
91
  3. Call queue management solution
92
92
  yolo solutions queue region=[(20, 400), (1080, 400), (1080, 360), (20, 360)] model=yolo11n.pt
@@ -694,7 +694,7 @@ def handle_yolo_solutions(args: List[str]) -> None:
694
694
  str(ROOT / "solutions/streamlit_inference.py"),
695
695
  "--server.headless",
696
696
  "true",
697
- overrides["model"],
697
+ overrides.pop("model", "yolo11n.pt"),
698
698
  ]
699
699
  )
700
700
  else:
@@ -1,5 +1,5 @@
1
1
  # Ultralytics YOLO 🚀, AGPL-3.0 license
2
- # COCO 2017 dataset https://cocodataset.org by Microsoft
2
+ # COCO 2017 Keypoints dataset https://cocodataset.org by Microsoft
3
3
  # Documentation: https://docs.ultralytics.com/datasets/pose/coco/
4
4
  # Example usage: yolo train data=coco-pose.yaml
5
5
  # parent
@@ -9,9 +9,9 @@
9
9
 
10
10
  # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
11
11
  path: ../datasets/coco-pose # dataset root dir
12
- train: train2017.txt # train images (relative to 'path') 118287 images
13
- val: val2017.txt # val images (relative to 'path') 5000 images
14
- test: test-dev2017.txt # 20288 of 40670 images, submit to https://competitions.codalab.org/competitions/20794
12
+ train: train2017.txt # train images (relative to 'path') 56599 images
13
+ val: val2017.txt # val images (relative to 'path') 2346 images
14
+ test: test-dev2017.txt # 20288 of 40670 images, submit to https://codalab.lisn.upsaclay.fr/competitions/7403
15
15
 
16
16
  # Keypoints
17
17
  kpt_shape: [17, 3] # number of keypoints, number of dims (2 for x,y or 3 for x,y,visible)
@@ -11,7 +11,7 @@
11
11
  path: ../datasets/lvis # dataset root dir
12
12
  train: train.txt # train images (relative to 'path') 100170 images
13
13
  val: val.txt # val images (relative to 'path') 19809 images
14
- minival: minival.txt # minval images (relative to 'path') 5000 images
14
+ minival: minival.txt # minival images (relative to 'path') 5000 images
15
15
 
16
16
  names:
17
17
  0: aerosol can/spray can
@@ -0,0 +1,21 @@
1
+ # Ultralytics YOLO 🚀, AGPL-3.0 license
2
+ # Medical-pills dataset by Ultralytics
3
+ # Documentation: https://docs.ultralytics.com/datasets/detect/medical-pills/
4
+ # Example usage: yolo train data=medical-pills.yaml
5
+ # parent
6
+ # ├── ultralytics
7
+ # └── datasets
8
+ # └── medical-pills ← downloads here (8.19 MB)
9
+
10
+ # Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
11
+ path: ../datasets/medical-pills # dataset root dir
12
+ train: train/images # train images (relative to 'path') 92 images
13
+ val: valid/images # val images (relative to 'path') 23 images
14
+ test: # test images (relative to 'path')
15
+
16
+ # Classes
17
+ names:
18
+ 0: pill
19
+
20
+ # Download script/URL (optional)
21
+ download: https://github.com/ultralytics/assets/releases/download/v0.0.0/medical-pills.zip
@@ -12,7 +12,7 @@ colormap: # (int | str) colormap for heatmap, Only OPENCV supported colormaps c
12
12
  # Workouts monitoring settings -----------------------------------------------------------------------------------------
13
13
  up_angle: 145.0 # (float) Workouts up_angle for counts, 145.0 is default value.
14
14
  down_angle: 90 # (float) Workouts down_angle for counts, 90 is default value. Y
15
- kpts: [6, 8, 10] # (list[int]) keypoints for workouts monitoring, i.e. for pushups kpts have values of [6, 8, 10].
15
+ kpts: [6, 8, 10] # (list[int]) keypoints for workouts monitoring, i.e. for push-ups kpts have values of [6, 8, 10].
16
16
 
17
17
  # Analytics settings ---------------------------------------------------------------------------------------------------
18
18
  analytics_type: "line" # (str) analytics type i.e "line", "pie", "bar" or "area" charts.
@@ -441,7 +441,8 @@ class BaseMixTransform:
441
441
  """
442
442
  raise NotImplementedError
443
443
 
444
- def _update_label_text(self, labels):
444
+ @staticmethod
445
+ def _update_label_text(labels):
445
446
  """
446
447
  Updates label text and class IDs for mixed labels in image augmentation.
447
448
 
@@ -1259,7 +1260,8 @@ class RandomPerspective:
1259
1260
  labels["resized_shape"] = img.shape[:2]
1260
1261
  return labels
1261
1262
 
1262
- def box_candidates(self, box1, box2, wh_thr=2, ar_thr=100, area_thr=0.1, eps=1e-16):
1263
+ @staticmethod
1264
+ def box_candidates(box1, box2, wh_thr=2, ar_thr=100, area_thr=0.1, eps=1e-16):
1263
1265
  """
1264
1266
  Compute candidate boxes for further processing based on size and aspect ratio criteria.
1265
1267
 
@@ -1598,7 +1600,8 @@ class LetterBox:
1598
1600
  else:
1599
1601
  return img
1600
1602
 
1601
- def _update_labels(self, labels, ratio, padw, padh):
1603
+ @staticmethod
1604
+ def _update_labels(labels, ratio, padw, padh):
1602
1605
  """
1603
1606
  Updates labels after applying letterboxing to an image.
1604
1607
 
@@ -68,7 +68,7 @@ class YOLODataset(BaseDataset):
68
68
  Cache dataset labels, check images and read shapes.
69
69
 
70
70
  Args:
71
- path (Path): Path where to save the cache file. Default is Path('./labels.cache').
71
+ path (Path): Path where to save the cache file. Default is Path("./labels.cache").
72
72
 
73
73
  Returns:
74
74
  (dict): labels.
@@ -219,7 +219,7 @@ class YOLODataset(BaseDataset):
219
219
  segment_resamples = 100 if self.use_obb else 1000
220
220
  if len(segments) > 0:
221
221
  # make sure segments interpolate correctly if original length is greater than segment_resamples
222
- max_len = max([len(s) for s in segments])
222
+ max_len = max(len(s) for s in segments)
223
223
  segment_resamples = (max_len + 1) if segment_resamples < max_len else segment_resamples
224
224
  # list[np.array(segment_resamples, 2)] * num_samples
225
225
  segments = np.stack(resample_segments(segments, n=segment_resamples), axis=0)
@@ -813,7 +813,7 @@ class Exporter:
813
813
  workspace = int(self.args.workspace * (1 << 30)) if self.args.workspace is not None else 0
814
814
  if is_trt10 and workspace > 0:
815
815
  config.set_memory_pool_limit(trt.MemoryPoolType.WORKSPACE, workspace)
816
- elif workspace > 0 and not is_trt10: # TensorRT versions 7, 8
816
+ elif workspace > 0: # TensorRT versions 7, 8
817
817
  config.max_workspace_size = workspace
818
818
  flag = 1 << int(trt.NetworkDefinitionCreationFlag.EXPLICIT_BATCH)
819
819
  network = builder.create_network(flag)
@@ -2,7 +2,7 @@
2
2
 
3
3
  import inspect
4
4
  from pathlib import Path
5
- from typing import Dict, List, Union
5
+ from typing import Any, Dict, List, Union
6
6
 
7
7
  import numpy as np
8
8
  import torch
@@ -152,7 +152,7 @@ class Model(nn.Module):
152
152
  self,
153
153
  source: Union[str, Path, int, Image.Image, list, tuple, np.ndarray, torch.Tensor] = None,
154
154
  stream: bool = False,
155
- **kwargs,
155
+ **kwargs: Any,
156
156
  ) -> list:
157
157
  """
158
158
  Alias for the predict method, enabling the model instance to be callable for predictions.
@@ -165,7 +165,7 @@ class Model(nn.Module):
165
165
  the image(s) to make predictions on. Can be a file path, URL, PIL image, numpy array, PyTorch
166
166
  tensor, or a list/tuple of these.
167
167
  stream (bool): If True, treat the input source as a continuous stream for predictions.
168
- **kwargs (Any): Additional keyword arguments to configure the prediction process.
168
+ **kwargs: Additional keyword arguments to configure the prediction process.
169
169
 
170
170
  Returns:
171
171
  (List[ultralytics.engine.results.Results]): A list of prediction results, each encapsulated in a
@@ -466,7 +466,7 @@ class Model(nn.Module):
466
466
  self,
467
467
  source: Union[str, Path, int, list, tuple, np.ndarray, torch.Tensor] = None,
468
468
  stream: bool = False,
469
- **kwargs,
469
+ **kwargs: Any,
470
470
  ) -> list:
471
471
  """
472
472
  Generates image embeddings based on the provided source.
@@ -478,7 +478,7 @@ class Model(nn.Module):
478
478
  source (str | Path | int | List | Tuple | np.ndarray | torch.Tensor): The source of the image for
479
479
  generating embeddings. Can be a file path, URL, PIL image, numpy array, etc.
480
480
  stream (bool): If True, predictions are streamed.
481
- **kwargs (Any): Additional keyword arguments for configuring the embedding process.
481
+ **kwargs: Additional keyword arguments for configuring the embedding process.
482
482
 
483
483
  Returns:
484
484
  (List[torch.Tensor]): A list containing the image embeddings.
@@ -501,7 +501,7 @@ class Model(nn.Module):
501
501
  source: Union[str, Path, int, Image.Image, list, tuple, np.ndarray, torch.Tensor] = None,
502
502
  stream: bool = False,
503
503
  predictor=None,
504
- **kwargs,
504
+ **kwargs: Any,
505
505
  ) -> List[Results]:
506
506
  """
507
507
  Performs predictions on the given image source using the YOLO model.
@@ -517,7 +517,7 @@ class Model(nn.Module):
517
517
  stream (bool): If True, treats the input source as a continuous stream for predictions.
518
518
  predictor (BasePredictor | None): An instance of a custom predictor class for making predictions.
519
519
  If None, the method uses a default predictor.
520
- **kwargs (Any): Additional keyword arguments for configuring the prediction process.
520
+ **kwargs: Additional keyword arguments for configuring the prediction process.
521
521
 
522
522
  Returns:
523
523
  (List[ultralytics.engine.results.Results]): A list of prediction results, each encapsulated in a
@@ -562,7 +562,7 @@ class Model(nn.Module):
562
562
  source: Union[str, Path, int, list, tuple, np.ndarray, torch.Tensor] = None,
563
563
  stream: bool = False,
564
564
  persist: bool = False,
565
- **kwargs,
565
+ **kwargs: Any,
566
566
  ) -> List[Results]:
567
567
  """
568
568
  Conducts object tracking on the specified input source using the registered trackers.
@@ -576,7 +576,7 @@ class Model(nn.Module):
576
576
  tracking. Can be a file path, URL, or video stream.
577
577
  stream (bool): If True, treats the input source as a continuous video stream. Defaults to False.
578
578
  persist (bool): If True, persists trackers between different calls to this method. Defaults to False.
579
- **kwargs (Any): Additional keyword arguments for configuring the tracking process.
579
+ **kwargs: Additional keyword arguments for configuring the tracking process.
580
580
 
581
581
  Returns:
582
582
  (List[ultralytics.engine.results.Results]): A list of tracking results, each a Results object.
@@ -607,7 +607,7 @@ class Model(nn.Module):
607
607
  def val(
608
608
  self,
609
609
  validator=None,
610
- **kwargs,
610
+ **kwargs: Any,
611
611
  ):
612
612
  """
613
613
  Validates the model using a specified dataset and validation configuration.
@@ -619,7 +619,7 @@ class Model(nn.Module):
619
619
  Args:
620
620
  validator (ultralytics.engine.validator.BaseValidator | None): An instance of a custom validator class for
621
621
  validating the model.
622
- **kwargs (Any): Arbitrary keyword arguments for customizing the validation process.
622
+ **kwargs: Arbitrary keyword arguments for customizing the validation process.
623
623
 
624
624
  Returns:
625
625
  (ultralytics.utils.metrics.DetMetrics): Validation metrics obtained from the validation process.
@@ -642,7 +642,7 @@ class Model(nn.Module):
642
642
 
643
643
  def benchmark(
644
644
  self,
645
- **kwargs,
645
+ **kwargs: Any,
646
646
  ):
647
647
  """
648
648
  Benchmarks the model across various export formats to evaluate performance.
@@ -653,7 +653,7 @@ class Model(nn.Module):
653
653
  defaults, and any additional user-provided keyword arguments.
654
654
 
655
655
  Args:
656
- **kwargs (Any): Arbitrary keyword arguments to customize the benchmarking process. These are combined with
656
+ **kwargs: Arbitrary keyword arguments to customize the benchmarking process. These are combined with
657
657
  default configurations, model-specific arguments, and method defaults. Common options include:
658
658
  - data (str): Path to the dataset for benchmarking.
659
659
  - imgsz (int | List[int]): Image size for benchmarking.
@@ -691,7 +691,7 @@ class Model(nn.Module):
691
691
 
692
692
  def export(
693
693
  self,
694
- **kwargs,
694
+ **kwargs: Any,
695
695
  ) -> str:
696
696
  """
697
697
  Exports the model to a different format suitable for deployment.
@@ -701,7 +701,7 @@ class Model(nn.Module):
701
701
  defaults, and any additional arguments provided.
702
702
 
703
703
  Args:
704
- **kwargs (Dict): Arbitrary keyword arguments to customize the export process. These are combined with
704
+ **kwargs: Arbitrary keyword arguments to customize the export process. These are combined with
705
705
  the model's overrides and method defaults. Common arguments include:
706
706
  format (str): Export format (e.g., 'onnx', 'engine', 'coreml').
707
707
  half (bool): Export model in half-precision.
@@ -740,7 +740,7 @@ class Model(nn.Module):
740
740
  def train(
741
741
  self,
742
742
  trainer=None,
743
- **kwargs,
743
+ **kwargs: Any,
744
744
  ):
745
745
  """
746
746
  Trains the model using the specified dataset and training configuration.
@@ -755,7 +755,7 @@ class Model(nn.Module):
755
755
 
756
756
  Args:
757
757
  trainer (BaseTrainer | None): Custom trainer instance for model training. If None, uses default.
758
- **kwargs (Any): Arbitrary keyword arguments for training configuration. Common options include:
758
+ **kwargs: Arbitrary keyword arguments for training configuration. Common options include:
759
759
  data (str): Path to dataset configuration file.
760
760
  epochs (int): Number of training epochs.
761
761
  batch_size (int): Batch size for training.
@@ -816,8 +816,8 @@ class Model(nn.Module):
816
816
  self,
817
817
  use_ray=False,
818
818
  iterations=10,
819
- *args,
820
- **kwargs,
819
+ *args: Any,
820
+ **kwargs: Any,
821
821
  ):
822
822
  """
823
823
  Conducts hyperparameter tuning for the model, with an option to use Ray Tune.
@@ -830,8 +830,8 @@ class Model(nn.Module):
830
830
  Args:
831
831
  use_ray (bool): If True, uses Ray Tune for hyperparameter tuning. Defaults to False.
832
832
  iterations (int): The number of tuning iterations to perform. Defaults to 10.
833
- *args (List): Variable length argument list for additional arguments.
834
- **kwargs (Dict): Arbitrary keyword arguments. These are combined with the model's overrides and defaults.
833
+ *args: Variable length argument list for additional arguments.
834
+ **kwargs: Arbitrary keyword arguments. These are combined with the model's overrides and defaults.
835
835
 
836
836
  Returns:
837
837
  (Dict): A dictionary containing the results of the hyperparameter search.
@@ -1170,6 +1170,4 @@ class Model(nn.Module):
1170
1170
  >>> print(model.stride)
1171
1171
  >>> print(model.task)
1172
1172
  """
1173
- if name == "model":
1174
- return self._modules["model"]
1175
- return getattr(self.model, name)
1173
+ return self._modules["model"] if name == "model" else getattr(self.model, name)
@@ -245,7 +245,7 @@ class BaseValidator:
245
245
 
246
246
  cost_matrix = iou * (iou >= threshold)
247
247
  if cost_matrix.any():
248
- labels_idx, detections_idx = scipy.optimize.linear_sum_assignment(cost_matrix, maximize=True)
248
+ labels_idx, detections_idx = scipy.optimize.linear_sum_assignment(cost_matrix)
249
249
  valid = cost_matrix[labels_idx, detections_idx] > 0
250
250
  if valid.any():
251
251
  correct[detections_idx[valid], i] = True
@@ -955,7 +955,8 @@ class TinyViT(nn.Module):
955
955
 
956
956
  self.apply(_check_lr_scale)
957
957
 
958
- def _init_weights(self, m):
958
+ @staticmethod
959
+ def _init_weights(m):
959
960
  """Initializes weights for linear and normalization layers in the TinyViT model."""
960
961
  if isinstance(m, nn.Linear):
961
962
  # NOTE: This initialization is needed only for training.
@@ -1377,7 +1377,7 @@ class SAM2VideoPredictor(SAM2Predictor):
1377
1377
  if "maskmem_pos_enc" not in model_constants:
1378
1378
  assert isinstance(out_maskmem_pos_enc, list)
1379
1379
  # only take the slice for one object, since it's same across objects
1380
- maskmem_pos_enc = [x[0:1].clone() for x in out_maskmem_pos_enc]
1380
+ maskmem_pos_enc = [x[:1].clone() for x in out_maskmem_pos_enc]
1381
1381
  model_constants["maskmem_pos_enc"] = maskmem_pos_enc
1382
1382
  else:
1383
1383
  maskmem_pos_enc = model_constants["maskmem_pos_enc"]
@@ -192,14 +192,14 @@ class AutoBackend(nn.Module):
192
192
  check_requirements("numpy==1.23.5")
193
193
  import onnxruntime
194
194
 
195
- providers = onnxruntime.get_available_providers()
196
- if not cuda and "CUDAExecutionProvider" in providers:
197
- providers.remove("CUDAExecutionProvider")
198
- elif cuda and "CUDAExecutionProvider" not in providers:
199
- LOGGER.warning("WARNING ⚠️ Failed to start ONNX Runtime session with CUDA. Falling back to CPU...")
195
+ providers = ["CPUExecutionProvider"]
196
+ if cuda and "CUDAExecutionProvider" in onnxruntime.get_available_providers():
197
+ providers.insert(0, "CUDAExecutionProvider")
198
+ elif cuda: # Only log warning if CUDA was requested but unavailable
199
+ LOGGER.warning("WARNING ⚠️ Failed to start ONNX Runtime with CUDA. Using CPU...")
200
200
  device = torch.device("cpu")
201
201
  cuda = False
202
- LOGGER.info(f"Preferring ONNX Runtime {providers[0]}")
202
+ LOGGER.info(f"Using ONNX Runtime {providers[0]}")
203
203
  if onnx:
204
204
  session = onnxruntime.InferenceSession(w, providers=providers)
205
205
  else:
@@ -429,10 +429,7 @@ class AutoBackend(nn.Module):
429
429
 
430
430
  import MNN
431
431
 
432
- config = {}
433
- config["precision"] = "low"
434
- config["backend"] = "CPU"
435
- config["numThread"] = (os.cpu_count() + 1) // 2
432
+ config = {"precision": "low", "backend": "CPU", "numThread": (os.cpu_count() + 1) // 2}
436
433
  rt = MNN.nn.create_runtime_manager((config,))
437
434
  net = MNN.nn.load_module_from_file(w, [], [], runtime_manager=rt, rearrange=True)
438
435
 
@@ -170,7 +170,7 @@ class Analytics(BaseSolution):
170
170
  for key in count_dict.keys():
171
171
  y_data_dict[key] = np.append(y_data_dict[key], float(count_dict[key]))
172
172
  if len(y_data_dict[key]) < max_length:
173
- y_data_dict[key] = np.pad(y_data_dict[key], (0, max_length - len(y_data_dict[key])), "constant")
173
+ y_data_dict[key] = np.pad(y_data_dict[key], (0, max_length - len(y_data_dict[key])))
174
174
  if len(x_data) > self.max_points:
175
175
  x_data = x_data[1:]
176
176
  for key in count_dict.keys():
@@ -45,6 +45,8 @@ class DistanceCalculation(BaseSolution):
45
45
  self.left_mouse_count = 0
46
46
  self.selected_boxes = {}
47
47
 
48
+ self.centroids = [] # Initialize empty list to store centroids
49
+
48
50
  def mouse_event_for_distance(self, event, x, y, flags, param):
49
51
  """
50
52
  Handles mouse events to select regions in a real-time video stream for distance calculation.
@@ -41,6 +41,7 @@ class Heatmap(ObjectCounter):
41
41
 
42
42
  # store colormap
43
43
  self.colormap = cv2.COLORMAP_PARULA if self.CFG["colormap"] is None else self.CFG["colormap"]
44
+ self.heatmap = None
44
45
 
45
46
  def heatmap_effect(self, box):
46
47
  """
@@ -34,7 +34,6 @@ class ParkingPtsSelection:
34
34
  canvas_max_height (int): Maximum height of the canvas.
35
35
 
36
36
  Methods:
37
- setup_ui: Sets up the Tkinter UI components.
38
37
  initialize_properties: Initializes the necessary properties.
39
38
  upload_image: Uploads an image, resizes it to fit the canvas, and displays it.
40
39
  on_canvas_click: Handles mouse clicks to add points for bounding boxes.
@@ -55,20 +54,22 @@ class ParkingPtsSelection:
55
54
  from tkinter import filedialog, messagebox
56
55
 
57
56
  self.tk, self.filedialog, self.messagebox = tk, filedialog, messagebox
58
- self.setup_ui()
59
- self.initialize_properties()
60
- self.master.mainloop()
61
-
62
- def setup_ui(self):
63
- """Sets up the Tkinter UI components for the parking zone points selection interface."""
64
- self.master = self.tk.Tk()
57
+ self.master = self.tk.Tk() # Reference to the main application window or parent widget
65
58
  self.master.title("Ultralytics Parking Zones Points Selector")
66
59
  self.master.resizable(False, False)
67
60
 
68
- # Canvas for image display
69
- self.canvas = self.tk.Canvas(self.master, bg="white")
61
+ self.canvas = self.tk.Canvas(self.master, bg="white") # Canvas widget for displaying images or graphics
70
62
  self.canvas.pack(side=self.tk.BOTTOM)
71
63
 
64
+ self.image = None # Variable to store the loaded image
65
+ self.canvas_image = None # Reference to the image displayed on the canvas
66
+ self.canvas_max_width = None # Maximum allowed width for the canvas
67
+ self.canvas_max_height = None # Maximum allowed height for the canvas
68
+ self.rg_data = None # Data related to region or annotation management
69
+ self.current_box = None # Stores the currently selected or active bounding box
70
+ self.imgh = None # Height of the current image
71
+ self.imgw = None # Width of the current image
72
+
72
73
  # Button frame with buttons
73
74
  button_frame = self.tk.Frame(self.master)
74
75
  button_frame.pack(side=self.tk.TOP)
@@ -80,6 +81,9 @@ class ParkingPtsSelection:
80
81
  ]:
81
82
  self.tk.Button(button_frame, text=text, command=cmd).pack(side=self.tk.LEFT)
82
83
 
84
+ self.initialize_properties()
85
+ self.master.mainloop()
86
+
83
87
  def initialize_properties(self):
84
88
  """Initialize properties for image, canvas, bounding boxes, and dimensions."""
85
89
  self.image = self.canvas_image = None
@@ -105,7 +109,7 @@ class ParkingPtsSelection:
105
109
  )
106
110
 
107
111
  self.canvas.config(width=canvas_width, height=canvas_height)
108
- self.canvas_image = ImageTk.PhotoImage(self.image.resize((canvas_width, canvas_height), Image.LANCZOS))
112
+ self.canvas_image = ImageTk.PhotoImage(self.image.resize((canvas_width, canvas_height)))
109
113
  self.canvas.create_image(0, 0, anchor=self.tk.NW, image=self.canvas_image)
110
114
  self.canvas.bind("<Button-1>", self.on_canvas_click)
111
115
 
@@ -144,8 +148,13 @@ class ParkingPtsSelection:
144
148
  """Saves the selected parking zone points to a JSON file with scaled coordinates."""
145
149
  scale_w, scale_h = self.imgw / self.canvas.winfo_width(), self.imgh / self.canvas.winfo_height()
146
150
  data = [{"points": [(int(x * scale_w), int(y * scale_h)) for x, y in box]} for box in self.rg_data]
147
- with open("bounding_boxes.json", "w") as f:
148
- json.dump(data, f, indent=4)
151
+
152
+ from io import StringIO # Function level import, as it's only required to store coordinates, not every frame
153
+
154
+ write_buffer = StringIO()
155
+ json.dump(data, write_buffer, indent=4)
156
+ with open("bounding_boxes.json", "w", encoding="utf-8") as f:
157
+ f.write(write_buffer.getvalue())
149
158
  self.messagebox.showinfo("Success", "Bounding boxes saved to bounding_boxes.json")
150
159
 
151
160
 
@@ -1,6 +1,7 @@
1
1
  # Ultralytics YOLO 🚀, AGPL-3.0 license
2
2
 
3
3
  from ultralytics.solutions.solutions import BaseSolution
4
+ from ultralytics.utils import LOGGER
4
5
  from ultralytics.utils.plotting import Annotator, colors
5
6
 
6
7
 
@@ -81,6 +82,9 @@ class RegionCounter(BaseSolution):
81
82
 
82
83
  # Draw regions and process counts for each defined area
83
84
  for idx, (region_name, reg_pts) in enumerate(regions.items(), start=1):
85
+ if not isinstance(reg_pts, list) or not all(isinstance(pt, tuple) for pt in reg_pts):
86
+ LOGGER.warning(f"Invalid region points for {region_name}: {reg_pts}")
87
+ continue # Skip invalid entries
84
88
  color = colors(idx, True)
85
89
  self.annotator.draw_region(reg_pts=reg_pts, color=color, thickness=self.line_width * 2)
86
90
  self.add_region(region_name, reg_pts, color, self.annotator.get_txt_color())