ultralytics 8.3.55__tar.gz → 8.3.57__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.55/ultralytics.egg-info → ultralytics-8.3.57}/PKG-INFO +1 -2
  2. {ultralytics-8.3.55 → ultralytics-8.3.57}/pyproject.toml +0 -1
  3. {ultralytics-8.3.55 → ultralytics-8.3.57}/tests/test_solutions.py +14 -7
  4. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/__init__.py +1 -1
  5. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/__init__.py +1 -1
  6. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/data/augment.py +7 -7
  7. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/data/converter.py +2 -2
  8. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/data/dataset.py +2 -1
  9. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/data/split_dota.py +1 -1
  10. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/data/utils.py +49 -0
  11. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/engine/exporter.py +7 -4
  12. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/sam/amg.py +1 -1
  13. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/sam/modules/blocks.py +11 -11
  14. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/sam/modules/sam.py +2 -2
  15. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/sam/predict.py +36 -37
  16. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/nn/autobackend.py +1 -1
  17. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/trackers/utils/gmc.py +12 -12
  18. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/__init__.py +5 -9
  19. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/metrics.py +1 -1
  20. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/plotting.py +1 -1
  21. {ultralytics-8.3.55 → ultralytics-8.3.57/ultralytics.egg-info}/PKG-INFO +1 -2
  22. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics.egg-info/requires.txt +0 -1
  23. {ultralytics-8.3.55 → ultralytics-8.3.57}/LICENSE +0 -0
  24. {ultralytics-8.3.55 → ultralytics-8.3.57}/README.md +0 -0
  25. {ultralytics-8.3.55 → ultralytics-8.3.57}/setup.cfg +0 -0
  26. {ultralytics-8.3.55 → ultralytics-8.3.57}/tests/__init__.py +0 -0
  27. {ultralytics-8.3.55 → ultralytics-8.3.57}/tests/conftest.py +0 -0
  28. {ultralytics-8.3.55 → ultralytics-8.3.57}/tests/test_cli.py +0 -0
  29. {ultralytics-8.3.55 → ultralytics-8.3.57}/tests/test_cuda.py +0 -0
  30. {ultralytics-8.3.55 → ultralytics-8.3.57}/tests/test_engine.py +0 -0
  31. {ultralytics-8.3.55 → ultralytics-8.3.57}/tests/test_exports.py +0 -0
  32. {ultralytics-8.3.55 → ultralytics-8.3.57}/tests/test_integrations.py +0 -0
  33. {ultralytics-8.3.55 → ultralytics-8.3.57}/tests/test_python.py +0 -0
  34. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/assets/bus.jpg +0 -0
  35. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/assets/zidane.jpg +0 -0
  36. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/Argoverse.yaml +0 -0
  37. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/DOTAv1.5.yaml +0 -0
  38. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/DOTAv1.yaml +0 -0
  39. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/GlobalWheat2020.yaml +0 -0
  40. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/ImageNet.yaml +0 -0
  41. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/Objects365.yaml +0 -0
  42. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/SKU-110K.yaml +0 -0
  43. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/VOC.yaml +0 -0
  44. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/VisDrone.yaml +0 -0
  45. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/african-wildlife.yaml +0 -0
  46. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/brain-tumor.yaml +0 -0
  47. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/carparts-seg.yaml +0 -0
  48. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/coco-pose.yaml +0 -0
  49. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/coco.yaml +0 -0
  50. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/coco128-seg.yaml +0 -0
  51. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/coco128.yaml +0 -0
  52. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/coco8-pose.yaml +0 -0
  53. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/coco8-seg.yaml +0 -0
  54. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/coco8.yaml +0 -0
  55. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/crack-seg.yaml +0 -0
  56. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/dog-pose.yaml +0 -0
  57. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/dota8.yaml +0 -0
  58. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/hand-keypoints.yaml +0 -0
  59. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/lvis.yaml +0 -0
  60. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/medical-pills.yaml +0 -0
  61. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/open-images-v7.yaml +0 -0
  62. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/package-seg.yaml +0 -0
  63. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/signature.yaml +0 -0
  64. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/tiger-pose.yaml +0 -0
  65. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/datasets/xView.yaml +0 -0
  66. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/default.yaml +0 -0
  67. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/11/yolo11-cls.yaml +0 -0
  68. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/11/yolo11-obb.yaml +0 -0
  69. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/11/yolo11-pose.yaml +0 -0
  70. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/11/yolo11-seg.yaml +0 -0
  71. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/11/yolo11.yaml +0 -0
  72. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/rt-detr/rtdetr-l.yaml +0 -0
  73. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/rt-detr/rtdetr-resnet101.yaml +0 -0
  74. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/rt-detr/rtdetr-resnet50.yaml +0 -0
  75. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/rt-detr/rtdetr-x.yaml +0 -0
  76. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v10/yolov10b.yaml +0 -0
  77. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v10/yolov10l.yaml +0 -0
  78. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v10/yolov10m.yaml +0 -0
  79. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v10/yolov10n.yaml +0 -0
  80. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v10/yolov10s.yaml +0 -0
  81. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v10/yolov10x.yaml +0 -0
  82. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v3/yolov3-spp.yaml +0 -0
  83. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v3/yolov3-tiny.yaml +0 -0
  84. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v3/yolov3.yaml +0 -0
  85. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v5/yolov5-p6.yaml +0 -0
  86. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v5/yolov5.yaml +0 -0
  87. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v6/yolov6.yaml +0 -0
  88. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v8/yolov8-cls-resnet101.yaml +0 -0
  89. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v8/yolov8-cls-resnet50.yaml +0 -0
  90. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v8/yolov8-cls.yaml +0 -0
  91. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v8/yolov8-ghost-p2.yaml +0 -0
  92. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v8/yolov8-ghost-p6.yaml +0 -0
  93. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v8/yolov8-ghost.yaml +0 -0
  94. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v8/yolov8-obb.yaml +0 -0
  95. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v8/yolov8-p2.yaml +0 -0
  96. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v8/yolov8-p6.yaml +0 -0
  97. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v8/yolov8-pose-p6.yaml +0 -0
  98. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v8/yolov8-pose.yaml +0 -0
  99. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v8/yolov8-rtdetr.yaml +0 -0
  100. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v8/yolov8-seg-p6.yaml +0 -0
  101. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v8/yolov8-seg.yaml +0 -0
  102. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v8/yolov8-world.yaml +0 -0
  103. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v8/yolov8-worldv2.yaml +0 -0
  104. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v8/yolov8.yaml +0 -0
  105. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v9/yolov9c-seg.yaml +0 -0
  106. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v9/yolov9c.yaml +0 -0
  107. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v9/yolov9e-seg.yaml +0 -0
  108. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v9/yolov9e.yaml +0 -0
  109. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v9/yolov9m.yaml +0 -0
  110. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v9/yolov9s.yaml +0 -0
  111. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/models/v9/yolov9t.yaml +0 -0
  112. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/solutions/default.yaml +0 -0
  113. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/trackers/botsort.yaml +0 -0
  114. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/cfg/trackers/bytetrack.yaml +0 -0
  115. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/data/__init__.py +0 -0
  116. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/data/annotator.py +0 -0
  117. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/data/base.py +0 -0
  118. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/data/build.py +0 -0
  119. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/data/loaders.py +0 -0
  120. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/engine/__init__.py +0 -0
  121. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/engine/model.py +0 -0
  122. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/engine/predictor.py +0 -0
  123. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/engine/results.py +0 -0
  124. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/engine/trainer.py +0 -0
  125. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/engine/tuner.py +0 -0
  126. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/engine/validator.py +0 -0
  127. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/hub/__init__.py +0 -0
  128. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/hub/auth.py +0 -0
  129. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/hub/google/__init__.py +0 -0
  130. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/hub/session.py +0 -0
  131. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/hub/utils.py +0 -0
  132. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/__init__.py +0 -0
  133. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/fastsam/__init__.py +0 -0
  134. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/fastsam/model.py +0 -0
  135. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/fastsam/predict.py +0 -0
  136. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/fastsam/utils.py +0 -0
  137. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/fastsam/val.py +0 -0
  138. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/nas/__init__.py +0 -0
  139. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/nas/model.py +0 -0
  140. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/nas/predict.py +0 -0
  141. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/nas/val.py +0 -0
  142. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/rtdetr/__init__.py +0 -0
  143. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/rtdetr/model.py +0 -0
  144. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/rtdetr/predict.py +0 -0
  145. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/rtdetr/train.py +0 -0
  146. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/rtdetr/val.py +0 -0
  147. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/sam/__init__.py +0 -0
  148. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/sam/build.py +0 -0
  149. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/sam/model.py +0 -0
  150. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/sam/modules/__init__.py +0 -0
  151. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/sam/modules/decoders.py +0 -0
  152. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/sam/modules/encoders.py +0 -0
  153. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/sam/modules/memory_attention.py +0 -0
  154. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/sam/modules/tiny_encoder.py +0 -0
  155. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/sam/modules/transformer.py +0 -0
  156. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/sam/modules/utils.py +0 -0
  157. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/utils/__init__.py +0 -0
  158. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/utils/loss.py +0 -0
  159. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/utils/ops.py +0 -0
  160. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/__init__.py +0 -0
  161. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/classify/__init__.py +0 -0
  162. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/classify/predict.py +0 -0
  163. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/classify/train.py +0 -0
  164. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/classify/val.py +0 -0
  165. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/detect/__init__.py +0 -0
  166. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/detect/predict.py +0 -0
  167. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/detect/train.py +0 -0
  168. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/detect/val.py +0 -0
  169. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/model.py +0 -0
  170. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/obb/__init__.py +0 -0
  171. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/obb/predict.py +0 -0
  172. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/obb/train.py +0 -0
  173. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/obb/val.py +0 -0
  174. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/pose/__init__.py +0 -0
  175. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/pose/predict.py +0 -0
  176. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/pose/train.py +0 -0
  177. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/pose/val.py +0 -0
  178. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/segment/__init__.py +0 -0
  179. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/segment/predict.py +0 -0
  180. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/segment/train.py +0 -0
  181. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/segment/val.py +0 -0
  182. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/world/__init__.py +0 -0
  183. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/world/train.py +0 -0
  184. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/models/yolo/world/train_world.py +0 -0
  185. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/nn/__init__.py +0 -0
  186. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/nn/modules/__init__.py +0 -0
  187. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/nn/modules/activation.py +0 -0
  188. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/nn/modules/block.py +0 -0
  189. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/nn/modules/conv.py +0 -0
  190. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/nn/modules/head.py +0 -0
  191. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/nn/modules/transformer.py +0 -0
  192. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/nn/modules/utils.py +0 -0
  193. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/nn/tasks.py +0 -0
  194. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/solutions/__init__.py +0 -0
  195. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/solutions/ai_gym.py +0 -0
  196. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/solutions/analytics.py +0 -0
  197. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/solutions/distance_calculation.py +0 -0
  198. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/solutions/heatmap.py +0 -0
  199. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/solutions/object_counter.py +0 -0
  200. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/solutions/parking_management.py +0 -0
  201. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/solutions/queue_management.py +0 -0
  202. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/solutions/region_counter.py +0 -0
  203. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/solutions/security_alarm.py +0 -0
  204. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/solutions/solutions.py +0 -0
  205. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/solutions/speed_estimation.py +0 -0
  206. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/solutions/streamlit_inference.py +0 -0
  207. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/solutions/trackzone.py +0 -0
  208. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/trackers/__init__.py +0 -0
  209. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/trackers/basetrack.py +0 -0
  210. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/trackers/bot_sort.py +0 -0
  211. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/trackers/byte_tracker.py +0 -0
  212. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/trackers/track.py +0 -0
  213. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/trackers/utils/__init__.py +0 -0
  214. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/trackers/utils/kalman_filter.py +0 -0
  215. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/trackers/utils/matching.py +0 -0
  216. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/autobatch.py +0 -0
  217. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/benchmarks.py +0 -0
  218. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/callbacks/__init__.py +0 -0
  219. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/callbacks/base.py +0 -0
  220. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/callbacks/clearml.py +0 -0
  221. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/callbacks/comet.py +0 -0
  222. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/callbacks/dvc.py +0 -0
  223. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/callbacks/hub.py +0 -0
  224. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/callbacks/mlflow.py +0 -0
  225. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/callbacks/neptune.py +0 -0
  226. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/callbacks/raytune.py +0 -0
  227. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/callbacks/tensorboard.py +0 -0
  228. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/callbacks/wb.py +0 -0
  229. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/checks.py +0 -0
  230. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/dist.py +0 -0
  231. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/downloads.py +0 -0
  232. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/errors.py +0 -0
  233. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/files.py +0 -0
  234. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/instance.py +0 -0
  235. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/loss.py +0 -0
  236. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/ops.py +0 -0
  237. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/patches.py +0 -0
  238. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/tal.py +0 -0
  239. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/torch_utils.py +0 -0
  240. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/triton.py +0 -0
  241. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics/utils/tuner.py +0 -0
  242. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics.egg-info/SOURCES.txt +0 -0
  243. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics.egg-info/dependency_links.txt +0 -0
  244. {ultralytics-8.3.55 → ultralytics-8.3.57}/ultralytics.egg-info/entry_points.txt +0 -0
  245. {ultralytics-8.3.55 → ultralytics-8.3.57}/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.55
3
+ Version: 8.3.57
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>
@@ -57,7 +57,6 @@ Requires-Dist: coverage[toml]; extra == "dev"
57
57
  Requires-Dist: mkdocs>=1.6.0; extra == "dev"
58
58
  Requires-Dist: mkdocs-material>=9.5.9; extra == "dev"
59
59
  Requires-Dist: mkdocstrings[python]; extra == "dev"
60
- Requires-Dist: mkdocs-jupyter; extra == "dev"
61
60
  Requires-Dist: mkdocs-redirects; extra == "dev"
62
61
  Requires-Dist: mkdocs-ultralytics-plugin>=0.1.8; extra == "dev"
63
62
  Requires-Dist: mkdocs-macros-plugin>=1.0.5; extra == "dev"
@@ -90,7 +90,6 @@ dev = [
90
90
  "mkdocs>=1.6.0",
91
91
  "mkdocs-material>=9.5.9",
92
92
  "mkdocstrings[python]",
93
- "mkdocs-jupyter", # notebooks
94
93
  "mkdocs-redirects", # 301 redirects
95
94
  "mkdocs-ultralytics-plugin>=0.1.8", # for meta descriptions and images, dates and authors
96
95
  "mkdocs-macros-plugin>=1.0.5" # duplicating content (i.e. export tables) in multiple places
@@ -14,46 +14,53 @@ POSE_VIDEO = "solution_ci_pose_demo.mp4"
14
14
 
15
15
  @pytest.mark.slow
16
16
  def test_major_solutions():
17
- """Test the object counting, heatmap, speed estimation and queue management solution."""
17
+ """Test the object counting, heatmap, speed estimation, trackzone and queue management solution."""
18
18
  safe_download(url=f"{ASSETS_URL}/{DEMO_VIDEO}", dir=TMP)
19
19
  cap = cv2.VideoCapture(str(TMP / DEMO_VIDEO))
20
20
  assert cap.isOpened(), "Error reading video file"
21
21
  region_points = [(20, 400), (1080, 400), (1080, 360), (20, 360)]
22
22
  counter = solutions.ObjectCounter(region=region_points, model="yolo11n.pt", show=False) # Test object counter
23
23
  heatmap = solutions.Heatmap(colormap=cv2.COLORMAP_PARULA, model="yolo11n.pt", show=False) # Test heatmaps
24
+ heatmap_count = solutions.Heatmap(
25
+ colormap=cv2.COLORMAP_PARULA, model="yolo11n.pt", show=False, region=region_points
26
+ ) # Test heatmaps with object counting
24
27
  speed = solutions.SpeedEstimator(region=region_points, model="yolo11n.pt", show=False) # Test queue manager
25
28
  queue = solutions.QueueManager(region=region_points, model="yolo11n.pt", show=False) # Test speed estimation
26
29
  line_analytics = solutions.Analytics(analytics_type="line", model="yolo11n.pt", show=False) # line analytics
27
30
  pie_analytics = solutions.Analytics(analytics_type="pie", model="yolo11n.pt", show=False) # line analytics
28
31
  bar_analytics = solutions.Analytics(analytics_type="bar", model="yolo11n.pt", show=False) # line analytics
29
32
  area_analytics = solutions.Analytics(analytics_type="area", model="yolo11n.pt", show=False) # line analytics
33
+ trackzone = solutions.TrackZone(region=region_points, model="yolo11n.pt", show=False) # Test trackzone
30
34
  frame_count = 0 # Required for analytics
31
35
  while cap.isOpened():
32
36
  success, im0 = cap.read()
33
37
  if not success:
34
38
  break
39
+ frame_count += 1
35
40
  original_im0 = im0.copy()
36
41
  _ = counter.count(original_im0.copy())
37
42
  _ = heatmap.generate_heatmap(original_im0.copy())
43
+ _ = heatmap_count.generate_heatmap(original_im0.copy())
38
44
  _ = speed.estimate_speed(original_im0.copy())
39
45
  _ = queue.process_queue(original_im0.copy())
40
46
  _ = line_analytics.process_data(original_im0.copy(), frame_count)
41
47
  _ = pie_analytics.process_data(original_im0.copy(), frame_count)
42
48
  _ = bar_analytics.process_data(original_im0.copy(), frame_count)
43
49
  _ = area_analytics.process_data(original_im0.copy(), frame_count)
50
+ _ = trackzone.trackzone(original_im0.copy())
44
51
  cap.release()
45
52
 
46
53
  # Test workouts monitoring
47
54
  safe_download(url=f"{ASSETS_URL}/{POSE_VIDEO}", dir=TMP)
48
- cap1 = cv2.VideoCapture(str(TMP / POSE_VIDEO))
49
- assert cap1.isOpened(), "Error reading video file"
50
- gym = solutions.AIGym(line_width=2, kpts=[5, 11, 13], show=False)
51
- while cap1.isOpened():
52
- success, im0 = cap1.read()
55
+ cap = cv2.VideoCapture(str(TMP / POSE_VIDEO))
56
+ assert cap.isOpened(), "Error reading video file"
57
+ gym = solutions.AIGym(kpts=[5, 11, 13], show=False)
58
+ while cap.isOpened():
59
+ success, im0 = cap.read()
53
60
  if not success:
54
61
  break
55
62
  _ = gym.monitor(im0)
56
- cap1.release()
63
+ cap.release()
57
64
 
58
65
 
59
66
  @pytest.mark.slow
@@ -1,6 +1,6 @@
1
1
  # Ultralytics YOLO 🚀, AGPL-3.0 license
2
2
 
3
- __version__ = "8.3.55"
3
+ __version__ = "8.3.57"
4
4
 
5
5
  import os
6
6
 
@@ -303,7 +303,7 @@ def get_cfg(cfg: Union[str, Path, Dict, SimpleNamespace] = DEFAULT_CFG_DICT, ove
303
303
  if k in cfg and isinstance(cfg[k], (int, float)):
304
304
  cfg[k] = str(cfg[k])
305
305
  if cfg.get("name") == "model": # assign model to 'name' arg
306
- cfg["name"] = cfg.get("model", "").split(".")[0]
306
+ cfg["name"] = str(cfg.get("model", "")).split(".")[0]
307
307
  LOGGER.warning(f"WARNING ⚠️ 'name=model' automatically updated to 'name={cfg['name']}'.")
308
308
 
309
309
  # Type and Value checks
@@ -642,7 +642,7 @@ class Mosaic(BaseMixTransform):
642
642
  c = s - w, s + h0 - h, s, s + h0
643
643
 
644
644
  padw, padh = c[:2]
645
- x1, y1, x2, y2 = (max(x, 0) for x in c) # allocate coords
645
+ x1, y1, x2, y2 = (max(x, 0) for x in c) # allocate coordinates
646
646
 
647
647
  img3[y1:y2, x1:x2] = img[y1 - padh :, x1 - padw :] # img3[ymin:ymax, xmin:xmax]
648
648
  # hp, wp = h, w # height, width previous for next iteration
@@ -771,7 +771,7 @@ class Mosaic(BaseMixTransform):
771
771
  c = s - w, s + h0 - hp - h, s, s + h0 - hp
772
772
 
773
773
  padw, padh = c[:2]
774
- x1, y1, x2, y2 = (max(x, 0) for x in c) # allocate coords
774
+ x1, y1, x2, y2 = (max(x, 0) for x in c) # allocate coordinates
775
775
 
776
776
  # Image
777
777
  img9[y1:y2, x1:x2] = img[y1 - padh :, x1 - padw :] # img9[ymin:ymax, xmin:xmax]
@@ -1283,7 +1283,7 @@ class RandomPerspective:
1283
1283
  eps (float): Small epsilon value to prevent division by zero.
1284
1284
 
1285
1285
  Returns:
1286
- (numpy.ndarray): Boolean array of shape (n,) indicating which boxes are candidates.
1286
+ (numpy.ndarray): Boolean array of shape (n) indicating which boxes are candidates.
1287
1287
  True values correspond to boxes that meet all criteria.
1288
1288
 
1289
1289
  Examples:
@@ -1320,7 +1320,7 @@ class RandomHSV:
1320
1320
  >>> augmenter = RandomHSV(hgain=0.5, sgain=0.5, vgain=0.5)
1321
1321
  >>> image = np.random.randint(0, 255, (100, 100, 3), dtype=np.uint8)
1322
1322
  >>> labels = {"img": image}
1323
- >>> augmented_labels = augmenter(labels)
1323
+ >>> augmenter(labels)
1324
1324
  >>> augmented_image = augmented_labels["img"]
1325
1325
  """
1326
1326
 
@@ -1337,7 +1337,7 @@ class RandomHSV:
1337
1337
 
1338
1338
  Examples:
1339
1339
  >>> hsv_aug = RandomHSV(hgain=0.5, sgain=0.5, vgain=0.5)
1340
- >>> augmented_image = hsv_aug(image)
1340
+ >>> hsv_aug(image)
1341
1341
  """
1342
1342
  self.hgain = hgain
1343
1343
  self.sgain = sgain
@@ -1419,7 +1419,7 @@ class RandomFlip:
1419
1419
 
1420
1420
  Examples:
1421
1421
  >>> flip = RandomFlip(p=0.5, direction="horizontal")
1422
- >>> flip = RandomFlip(p=0.7, direction="vertical", flip_idx=[1, 0, 3, 2, 5, 4])
1422
+ >>> flip_with_idx = RandomFlip(p=0.7, direction="vertical", flip_idx=[1, 0, 3, 2, 5, 4])
1423
1423
  """
1424
1424
  assert direction in {"horizontal", "vertical"}, f"Support direction `horizontal` or `vertical`, got {direction}"
1425
1425
  assert 0 <= p <= 1.0, f"The probability should be in range [0, 1], but got {p}."
@@ -2022,7 +2022,7 @@ class Format:
2022
2022
  Returns:
2023
2023
  (Dict): A dictionary with formatted data, including:
2024
2024
  - 'img': Formatted image tensor.
2025
- - 'cls': Class labels tensor.
2025
+ - 'cls': Class label's tensor.
2026
2026
  - 'bboxes': Bounding boxes tensor in the specified format.
2027
2027
  - 'masks': Instance masks tensor (if return_mask is True).
2028
2028
  - 'keypoints': Keypoints tensor (if return_keypoint is True).
@@ -241,7 +241,7 @@ def convert_coco(
241
241
  ```python
242
242
  from ultralytics.data.converter import convert_coco
243
243
 
244
- convert_coco("../datasets/coco/annotations/", use_segments=True, use_keypoints=False, cls91to80=True)
244
+ convert_coco("../datasets/coco/annotations/", use_segments=True, use_keypoints=False, cls91to80=False)
245
245
  convert_coco("../datasets/lvis/annotations/", use_segments=True, use_keypoints=False, cls91to80=False, lvis=True)
246
246
  ```
247
247
 
@@ -266,7 +266,7 @@ def convert_coco(
266
266
  # since LVIS val set contains images from COCO 2017 train in addition to the COCO 2017 val split.
267
267
  (fn / "train2017").mkdir(parents=True, exist_ok=True)
268
268
  (fn / "val2017").mkdir(parents=True, exist_ok=True)
269
- with open(json_file) as f:
269
+ with open(json_file, encoding="utf-8") as f:
270
270
  data = json.load(f)
271
271
 
272
272
  # Create image dict
@@ -323,7 +323,8 @@ class GroundingDataset(YOLODataset):
323
323
  if box[2] <= 0 or box[3] <= 0:
324
324
  continue
325
325
 
326
- cat_name = " ".join([img["caption"][t[0] : t[1]] for t in ann["tokens_positive"]])
326
+ caption = img["caption"]
327
+ cat_name = " ".join([caption[t[0] : t[1]] for t in ann["tokens_positive"]])
327
328
  if cat_name not in cat2id:
328
329
  cat2id[cat_name] = len(cat2id)
329
330
  texts.append([cat_name])
@@ -67,7 +67,7 @@ def load_yolo_dota(data_root, split="train"):
67
67
 
68
68
  Args:
69
69
  data_root (str): Data root.
70
- split (str): The split data set, could be train or val.
70
+ split (str): The split data set, could be `train` or `val`.
71
71
 
72
72
  Notes:
73
73
  The directory structure assumed for the DOTA dataset:
@@ -167,6 +167,55 @@ def verify_image_label(args):
167
167
  return [None, None, None, None, None, nm, nf, ne, nc, msg]
168
168
 
169
169
 
170
+ def visualize_image_annotations(image_path, txt_path, label_map):
171
+ """
172
+ Visualizes YOLO annotations (bounding boxes and class labels) on an image.
173
+
174
+ This function reads an image and its corresponding annotation file in YOLO format, then
175
+ draws bounding boxes around detected objects and labels them with their respective class names.
176
+ The bounding box colors are assigned based on the class ID, and the text color is dynamically
177
+ adjusted for readability, depending on the background color's luminance.
178
+
179
+ Args:
180
+ image_path (str): The path to the image file to annotate, and it can be in formats supported by PIL (e.g., .jpg, .png).
181
+ txt_path (str): The path to the annotation file in YOLO format, that should contain one line per object with:
182
+ - class_id (int): The class index.
183
+ - x_center (float): The X center of the bounding box (relative to image width).
184
+ - y_center (float): The Y center of the bounding box (relative to image height).
185
+ - width (float): The width of the bounding box (relative to image width).
186
+ - height (float): The height of the bounding box (relative to image height).
187
+ label_map (dict): A dictionary that maps class IDs (integers) to class labels (strings).
188
+
189
+ Example:
190
+ >>> label_map = {0: "cat", 1: "dog", 2: "bird"} # It should include all annotated classes details
191
+ >>> visualize_image_annotations("path/to/image.jpg", "path/to/annotations.txt", label_map)
192
+ """
193
+ import matplotlib.pyplot as plt
194
+
195
+ from ultralytics.utils.plotting import colors
196
+
197
+ img = np.array(Image.open(image_path))
198
+ img_height, img_width = img.shape[:2]
199
+ annotations = []
200
+ with open(txt_path) as file:
201
+ for line in file:
202
+ class_id, x_center, y_center, width, height = map(float, line.split())
203
+ x = (x_center - width / 2) * img_width
204
+ y = (y_center - height / 2) * img_height
205
+ w = width * img_width
206
+ h = height * img_height
207
+ annotations.append((x, y, w, h, int(class_id)))
208
+ fig, ax = plt.subplots(1) # Plot the image and annotations
209
+ for x, y, w, h, label in annotations:
210
+ color = tuple(c / 255 for c in colors(label, True)) # Get and normalize the RGB color
211
+ rect = plt.Rectangle((x, y), w, h, linewidth=2, edgecolor=color, facecolor="none") # Create a rectangle
212
+ ax.add_patch(rect)
213
+ luminance = 0.2126 * color[0] + 0.7152 * color[1] + 0.0722 * color[2] # Formula for luminance
214
+ ax.text(x, y - 5, label_map[label], color="white" if luminance < 0.5 else "black", backgroundcolor=color)
215
+ ax.imshow(img)
216
+ plt.show()
217
+
218
+
170
219
  def polygon2mask(imgsz, polygons, color=1, downsample_ratio=1):
171
220
  """
172
221
  Convert a list of polygons to a binary mask of the specified image size.
@@ -250,7 +250,8 @@ class Exporter:
250
250
  self.device = select_device("cpu" if self.args.device is None else self.args.device)
251
251
 
252
252
  # Argument compatibility checks
253
- validate_args(fmt, self.args, fmts_dict["Arguments"][flags.index(True) + 1])
253
+ fmt_keys = fmts_dict["Arguments"][flags.index(True) + 1]
254
+ validate_args(fmt, self.args, fmt_keys)
254
255
  if imx and not self.args.int8:
255
256
  LOGGER.warning("WARNING ⚠️ IMX only supports int8 export, setting int8=True.")
256
257
  self.args.int8 = True
@@ -285,6 +286,7 @@ class Exporter:
285
286
  "(torchscript, onnx, openvino, engine, coreml) formats. "
286
287
  "See https://docs.ultralytics.com/models/yolo-world for details."
287
288
  )
289
+ model.clip_model = None # openvino int8 export error: https://github.com/ultralytics/ultralytics/pull/18445
288
290
  if self.args.int8 and not self.args.data:
289
291
  self.args.data = DEFAULT_CFG.data or TASK2DATA[getattr(model, "task", "detect")] # assign default data
290
292
  LOGGER.warning(
@@ -368,6 +370,7 @@ class Exporter:
368
370
  "batch": self.args.batch,
369
371
  "imgsz": self.imgsz,
370
372
  "names": model.names,
373
+ "args": {k: v for k, v in self.args if k in fmt_keys},
371
374
  } # model metadata
372
375
  if model.task == "pose":
373
376
  self.metadata["kpt_shape"] = model.model[-1].kpt_shape
@@ -602,7 +605,7 @@ class Exporter:
602
605
  @try_export
603
606
  def export_paddle(self, prefix=colorstr("PaddlePaddle:")):
604
607
  """YOLO Paddle export."""
605
- check_requirements(("paddlepaddle", "x2paddle"))
608
+ check_requirements(("paddlepaddle-gpu" if torch.cuda.is_available() else "paddlepaddle", "x2paddle"))
606
609
  import x2paddle # noqa
607
610
  from x2paddle.convert import pytorch2paddle # noqa
608
611
 
@@ -949,7 +952,7 @@ class Exporter:
949
952
  "sng4onnx>=1.0.1", # required by 'onnx2tf' package
950
953
  "onnx_graphsurgeon>=0.3.26", # required by 'onnx2tf' package
951
954
  "onnx>=1.12.0",
952
- "onnx2tf>1.17.5,<=1.22.3",
955
+ "onnx2tf>1.17.5,<=1.26.3",
953
956
  "onnxslim>=0.1.31",
954
957
  "tflite_support<=0.4.3" if IS_JETSON else "tflite_support", # fix ImportError 'GLIBCXX_3.4.29'
955
958
  "flatbuffers>=23.5.26,<100", # update old 'flatbuffers' included inside tensorflow package
@@ -1136,7 +1139,7 @@ class Exporter:
1136
1139
  if getattr(self.model, "end2end", False):
1137
1140
  raise ValueError("IMX export is not supported for end2end models.")
1138
1141
  if "C2f" not in self.model.__str__():
1139
- raise ValueError("IMX export is only supported for YOLOv8 detection models")
1142
+ raise ValueError("IMX export is only supported for YOLOv8n detection models")
1140
1143
  check_requirements(("model-compression-toolkit==2.1.1", "sony-custom-layers==0.2.0", "tensorflow==2.12.0"))
1141
1144
  check_requirements("imx500-converter[pt]==3.14.3") # Separate requirements for imx500-converter
1142
1145
 
@@ -76,7 +76,7 @@ def build_all_layer_point_grids(n_per_side: int, n_layers: int, scale_per_layer:
76
76
  def generate_crop_boxes(
77
77
  im_size: Tuple[int, ...], n_layers: int, overlap_ratio: float
78
78
  ) -> Tuple[List[List[int]], List[int]]:
79
- """Generates crop boxes of varying sizes for multi-scale image processing, with layered overlapping regions."""
79
+ """Generates crop boxes of varying sizes for multiscale image processing, with layered overlapping regions."""
80
80
  crop_boxes, layer_idxs = [], []
81
81
  im_h, im_w = im_size
82
82
  short_side = min(im_h, im_w)
@@ -502,11 +502,11 @@ def do_pool(x: torch.Tensor, pool: nn.Module, norm: nn.Module = None) -> torch.T
502
502
 
503
503
  class MultiScaleAttention(nn.Module):
504
504
  """
505
- Implements multi-scale self-attention with optional query pooling for efficient feature extraction.
505
+ Implements multiscale self-attention with optional query pooling for efficient feature extraction.
506
506
 
507
- This class provides a flexible implementation of multi-scale attention, allowing for optional
507
+ This class provides a flexible implementation of multiscale attention, allowing for optional
508
508
  downsampling of query features through pooling. It's designed to enhance the model's ability to
509
- capture multi-scale information in visual tasks.
509
+ capture multiscale information in visual tasks.
510
510
 
511
511
  Attributes:
512
512
  dim (int): Input dimension of the feature map.
@@ -518,7 +518,7 @@ class MultiScaleAttention(nn.Module):
518
518
  proj (nn.Linear): Output projection.
519
519
 
520
520
  Methods:
521
- forward: Applies multi-scale attention to the input tensor.
521
+ forward: Applies multiscale attention to the input tensor.
522
522
 
523
523
  Examples:
524
524
  >>> import torch
@@ -537,7 +537,7 @@ class MultiScaleAttention(nn.Module):
537
537
  num_heads: int,
538
538
  q_pool: nn.Module = None,
539
539
  ):
540
- """Initializes multi-scale attention with optional query pooling for efficient feature extraction."""
540
+ """Initializes multiscale attention with optional query pooling for efficient feature extraction."""
541
541
  super().__init__()
542
542
 
543
543
  self.dim = dim
@@ -552,7 +552,7 @@ class MultiScaleAttention(nn.Module):
552
552
  self.proj = nn.Linear(dim_out, dim_out)
553
553
 
554
554
  def forward(self, x: torch.Tensor) -> torch.Tensor:
555
- """Applies multi-scale attention with optional query pooling to extract multi-scale features."""
555
+ """Applies multiscale attention with optional query pooling to extract multiscale features."""
556
556
  B, H, W, _ = x.shape
557
557
  # qkv with shape (B, H * W, 3, nHead, C)
558
558
  qkv = self.qkv(x).reshape(B, H * W, 3, self.num_heads, -1)
@@ -582,9 +582,9 @@ class MultiScaleAttention(nn.Module):
582
582
 
583
583
  class MultiScaleBlock(nn.Module):
584
584
  """
585
- A multi-scale attention block with window partitioning and query pooling for efficient vision transformers.
585
+ A multiscale attention block with window partitioning and query pooling for efficient vision transformers.
586
586
 
587
- This class implements a multi-scale attention mechanism with optional window partitioning and downsampling,
587
+ This class implements a multiscale attention mechanism with optional window partitioning and downsampling,
588
588
  designed for use in vision transformer architectures.
589
589
 
590
590
  Attributes:
@@ -601,7 +601,7 @@ class MultiScaleBlock(nn.Module):
601
601
  proj (nn.Linear | None): Projection layer for dimension mismatch.
602
602
 
603
603
  Methods:
604
- forward: Processes input tensor through the multi-scale block.
604
+ forward: Processes input tensor through the multiscale block.
605
605
 
606
606
  Examples:
607
607
  >>> block = MultiScaleBlock(dim=256, dim_out=512, num_heads=8, window_size=7)
@@ -623,7 +623,7 @@ class MultiScaleBlock(nn.Module):
623
623
  act_layer: nn.Module = nn.GELU,
624
624
  window_size: int = 0,
625
625
  ):
626
- """Initializes a multi-scale attention block with window partitioning and optional query pooling."""
626
+ """Initializes a multiscale attention block with window partitioning and optional query pooling."""
627
627
  super().__init__()
628
628
 
629
629
  if isinstance(norm_layer, str):
@@ -660,7 +660,7 @@ class MultiScaleBlock(nn.Module):
660
660
  self.proj = nn.Linear(dim, dim_out)
661
661
 
662
662
  def forward(self, x: torch.Tensor) -> torch.Tensor:
663
- """Processes input through multi-scale attention and MLP, with optional windowing and downsampling."""
663
+ """Processes input through multiscale attention and MLP, with optional windowing and downsampling."""
664
664
  shortcut = x # B, H, W, C
665
665
  x = self.norm1(x)
666
666
 
@@ -425,7 +425,7 @@ class SAM2Model(torch.nn.Module):
425
425
  low_res_masks: Tensor of shape (B, 1, H*4, W*4) with the best low-resolution mask.
426
426
  high_res_masks: Tensor of shape (B, 1, H*16, W*16) with the best high-resolution mask.
427
427
  obj_ptr: Tensor of shape (B, C) with object pointer vector for the output mask.
428
- object_score_logits: Tensor of shape (B,) with object score logits.
428
+ object_score_logits: Tensor of shape (B) with object score logits.
429
429
 
430
430
  Where M is 3 if multimask_output=True, and 1 if multimask_output=False.
431
431
 
@@ -643,7 +643,7 @@ class SAM2Model(torch.nn.Module):
643
643
  if not is_init_cond_frame:
644
644
  # Retrieve the memories encoded with the maskmem backbone
645
645
  to_cat_memory, to_cat_memory_pos_embed = [], []
646
- # Add conditioning frames's output first (all cond frames have t_pos=0 for
646
+ # Add conditioning frame's output first (all cond frames have t_pos=0 for
647
647
  # when getting temporal positional embedding below)
648
648
  assert len(output_dict["cond_frame_outputs"]) > 0
649
649
  # Select a maximum number of temporally closest cond frames for cross attention
@@ -91,9 +91,9 @@ class Predictor(BasePredictor):
91
91
  _callbacks (Dict | None): Dictionary of callback functions to customize behavior.
92
92
 
93
93
  Examples:
94
- >>> predictor = Predictor(cfg=DEFAULT_CFG)
95
- >>> predictor = Predictor(overrides={"imgsz": 640})
96
- >>> predictor = Predictor(_callbacks={"on_predict_start": custom_callback})
94
+ >>> predictor_example = Predictor(cfg=DEFAULT_CFG)
95
+ >>> predictor_example_with_imgsz = Predictor(overrides={"imgsz": 640})
96
+ >>> predictor_example_with_callback = Predictor(_callbacks={"on_predict_start": custom_callback})
97
97
  """
98
98
  if overrides is None:
99
99
  overrides = {}
@@ -215,7 +215,7 @@ class Predictor(BasePredictor):
215
215
  im (torch.Tensor): Preprocessed input image tensor with shape (N, C, H, W).
216
216
  bboxes (np.ndarray | List | None): Bounding boxes in XYXY format with shape (N, 4).
217
217
  points (np.ndarray | List | None): Points indicating object locations with shape (N, 2) or (N, num_points, 2), in pixels.
218
- labels (np.ndarray | List | None): Point prompt labels with shape (N,) or (N, num_points). 1 for foreground, 0 for background.
218
+ labels (np.ndarray | List | None): Point prompt labels with shape (N) or (N, num_points). 1 for foreground, 0 for background.
219
219
  masks (np.ndarray | None): Low-res masks from previous predictions with shape (N, H, W). For SAM, H=W=256.
220
220
  multimask_output (bool): Flag to return multiple masks for ambiguous prompts.
221
221
 
@@ -260,7 +260,7 @@ class Predictor(BasePredictor):
260
260
  dst_shape (tuple): The target shape (height, width) for the prompts.
261
261
  bboxes (np.ndarray | List | None): Bounding boxes in XYXY format with shape (N, 4).
262
262
  points (np.ndarray | List | None): Points indicating object locations with shape (N, 2) or (N, num_points, 2), in pixels.
263
- labels (np.ndarray | List | None): Point prompt labels with shape (N,) or (N, num_points). 1 for foreground, 0 for background.
263
+ labels (np.ndarray | List | None): Point prompt labels with shape (N) or (N, num_points). 1 for foreground, 0 for background.
264
264
  masks (List | np.ndarray, Optional): Masks for the objects, where each mask is a 2D array.
265
265
 
266
266
  Raises:
@@ -853,8 +853,8 @@ class SAM2VideoPredictor(SAM2Predictor):
853
853
 
854
854
  Examples:
855
855
  >>> predictor = SAM2VideoPredictor(cfg=DEFAULT_CFG)
856
- >>> predictor = SAM2VideoPredictor(overrides={"imgsz": 640})
857
- >>> predictor = SAM2VideoPredictor(_callbacks={"on_predict_start": custom_callback})
856
+ >>> predictor_example_with_imgsz = SAM2VideoPredictor(overrides={"imgsz": 640})
857
+ >>> predictor_example_with_callback = SAM2VideoPredictor(_callbacks={"on_predict_start": custom_callback})
858
858
  """
859
859
  super().__init__(cfg, overrides, _callbacks)
860
860
  self.inference_state = {}
@@ -1096,7 +1096,7 @@ class SAM2VideoPredictor(SAM2Predictor):
1096
1096
  # to `propagate_in_video_preflight`).
1097
1097
  consolidated_frame_inds = self.inference_state["consolidated_frame_inds"]
1098
1098
  for is_cond in {False, True}:
1099
- # Separately consolidate conditioning and non-conditioning temp outptus
1099
+ # Separately consolidate conditioning and non-conditioning temp outputs
1100
1100
  storage_key = "cond_frame_outputs" if is_cond else "non_cond_frame_outputs"
1101
1101
  # Find all the frames that contain temporary outputs for any objects
1102
1102
  # (these should be the frames that have just received clicks for mask inputs
@@ -1161,36 +1161,35 @@ class SAM2VideoPredictor(SAM2Predictor):
1161
1161
  assert predictor.dataset is not None
1162
1162
  assert predictor.dataset.mode == "video"
1163
1163
 
1164
- inference_state = {}
1165
- inference_state["num_frames"] = predictor.dataset.frames
1166
- # inputs on each frame
1167
- inference_state["point_inputs_per_obj"] = {}
1168
- inference_state["mask_inputs_per_obj"] = {}
1169
- # values that don't change across frames (so we only need to hold one copy of them)
1170
- inference_state["constants"] = {}
1171
- # mapping between client-side object id and model-side object index
1172
- inference_state["obj_id_to_idx"] = OrderedDict()
1173
- inference_state["obj_idx_to_id"] = OrderedDict()
1174
- inference_state["obj_ids"] = []
1175
- # A storage to hold the model's tracking results and states on each frame
1176
- inference_state["output_dict"] = {
1177
- "cond_frame_outputs": {}, # dict containing {frame_idx: <out>}
1178
- "non_cond_frame_outputs": {}, # dict containing {frame_idx: <out>}
1179
- }
1180
- # Slice (view) of each object tracking results, sharing the same memory with "output_dict"
1181
- inference_state["output_dict_per_obj"] = {}
1182
- # A temporary storage to hold new outputs when user interact with a frame
1183
- # to add clicks or mask (it's merged into "output_dict" before propagation starts)
1184
- inference_state["temp_output_dict_per_obj"] = {}
1185
- # Frames that already holds consolidated outputs from click or mask inputs
1186
- # (we directly use their consolidated outputs during tracking)
1187
- inference_state["consolidated_frame_inds"] = {
1188
- "cond_frame_outputs": set(), # set containing frame indices
1189
- "non_cond_frame_outputs": set(), # set containing frame indices
1164
+ inference_state = {
1165
+ "num_frames": predictor.dataset.frames,
1166
+ "point_inputs_per_obj": {}, # inputs points on each frame
1167
+ "mask_inputs_per_obj": {}, # inputs mask on each frame
1168
+ "constants": {}, # values that don't change across frames (so we only need to hold one copy of them)
1169
+ # mapping between client-side object id and model-side object index
1170
+ "obj_id_to_idx": OrderedDict(),
1171
+ "obj_idx_to_id": OrderedDict(),
1172
+ "obj_ids": [],
1173
+ # A storage to hold the model's tracking results and states on each frame
1174
+ "output_dict": {
1175
+ "cond_frame_outputs": {}, # dict containing {frame_idx: <out>}
1176
+ "non_cond_frame_outputs": {}, # dict containing {frame_idx: <out>}
1177
+ },
1178
+ # Slice (view) of each object tracking results, sharing the same memory with "output_dict"
1179
+ "output_dict_per_obj": {},
1180
+ # A temporary storage to hold new outputs when user interact with a frame
1181
+ # to add clicks or mask (it's merged into "output_dict" before propagation starts)
1182
+ "temp_output_dict_per_obj": {},
1183
+ # Frames that already holds consolidated outputs from click or mask inputs
1184
+ # (we directly use their consolidated outputs during tracking)
1185
+ "consolidated_frame_inds": {
1186
+ "cond_frame_outputs": set(), # set containing frame indices
1187
+ "non_cond_frame_outputs": set(), # set containing frame indices
1188
+ },
1189
+ # metadata for each tracking frame (e.g. which direction it's tracked)
1190
+ "tracking_has_started": False,
1191
+ "frames_already_tracked": [],
1190
1192
  }
1191
- # metadata for each tracking frame (e.g. which direction it's tracked)
1192
- inference_state["tracking_has_started"] = False
1193
- inference_state["frames_already_tracked"] = []
1194
1193
  predictor.inference_state = inference_state
1195
1194
 
1196
1195
  def get_im_features(self, im, batch=1):
@@ -133,7 +133,7 @@ class AutoBackend(nn.Module):
133
133
 
134
134
  # Set device
135
135
  cuda = torch.cuda.is_available() and device.type != "cpu" # use CUDA
136
- if cuda and not any([nn_module, pt, jit, engine, onnx]): # GPU dataloader formats
136
+ if cuda and not any([nn_module, pt, jit, engine, onnx, paddle]): # GPU dataloader formats
137
137
  device = torch.device("cpu")
138
138
  cuda = False
139
139
 
@@ -26,9 +26,9 @@ class GMC:
26
26
  Methods:
27
27
  __init__: Initializes a GMC object with the specified method and downscale factor.
28
28
  apply: Applies the chosen method to a raw frame and optionally uses provided detections.
29
- applyEcc: Applies the ECC algorithm to a raw frame.
30
- applyFeatures: Applies feature-based methods like ORB or SIFT to a raw frame.
31
- applySparseOptFlow: Applies the Sparse Optical Flow method to a raw frame.
29
+ apply_ecc: Applies the ECC algorithm to a raw frame.
30
+ apply_features: Applies feature-based methods like ORB or SIFT to a raw frame.
31
+ apply_sparseoptflow: Applies the Sparse Optical Flow method to a raw frame.
32
32
  reset_params: Resets the internal parameters of the GMC object.
33
33
 
34
34
  Examples:
@@ -108,15 +108,15 @@ class GMC:
108
108
  (480, 640, 3)
109
109
  """
110
110
  if self.method in {"orb", "sift"}:
111
- return self.applyFeatures(raw_frame, detections)
111
+ return self.apply_features(raw_frame, detections)
112
112
  elif self.method == "ecc":
113
- return self.applyEcc(raw_frame)
113
+ return self.apply_ecc(raw_frame)
114
114
  elif self.method == "sparseOptFlow":
115
- return self.applySparseOptFlow(raw_frame)
115
+ return self.apply_sparseoptflow(raw_frame)
116
116
  else:
117
117
  return np.eye(2, 3)
118
118
 
119
- def applyEcc(self, raw_frame: np.array) -> np.array:
119
+ def apply_ecc(self, raw_frame: np.array) -> np.array:
120
120
  """
121
121
  Apply the ECC (Enhanced Correlation Coefficient) algorithm to a raw frame for motion compensation.
122
122
 
@@ -128,7 +128,7 @@ class GMC:
128
128
 
129
129
  Examples:
130
130
  >>> gmc = GMC(method="ecc")
131
- >>> processed_frame = gmc.applyEcc(np.array([[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]))
131
+ >>> processed_frame = gmc.apply_ecc(np.array([[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]))
132
132
  >>> print(processed_frame)
133
133
  [[1. 0. 0.]
134
134
  [0. 1. 0.]]
@@ -161,7 +161,7 @@ class GMC:
161
161
 
162
162
  return H
163
163
 
164
- def applyFeatures(self, raw_frame: np.array, detections: list = None) -> np.array:
164
+ def apply_features(self, raw_frame: np.array, detections: list = None) -> np.array:
165
165
  """
166
166
  Apply feature-based methods like ORB or SIFT to a raw frame.
167
167
 
@@ -175,7 +175,7 @@ class GMC:
175
175
  Examples:
176
176
  >>> gmc = GMC(method="orb")
177
177
  >>> raw_frame = np.random.randint(0, 255, (480, 640, 3), dtype=np.uint8)
178
- >>> processed_frame = gmc.applyFeatures(raw_frame)
178
+ >>> processed_frame = gmc.apply_features(raw_frame)
179
179
  >>> print(processed_frame.shape)
180
180
  (2, 3)
181
181
  """
@@ -304,7 +304,7 @@ class GMC:
304
304
 
305
305
  return H
306
306
 
307
- def applySparseOptFlow(self, raw_frame: np.array) -> np.array:
307
+ def apply_sparseoptflow(self, raw_frame: np.array) -> np.array:
308
308
  """
309
309
  Apply Sparse Optical Flow method to a raw frame.
310
310
 
@@ -316,7 +316,7 @@ class GMC:
316
316
 
317
317
  Examples:
318
318
  >>> gmc = GMC()
319
- >>> result = gmc.applySparseOptFlow(np.array([[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]))
319
+ >>> result = gmc.apply_sparseoptflow(np.array([[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]))
320
320
  >>> print(result)
321
321
  [[1. 0. 0.]
322
322
  [0. 1. 0.]]